• Post Reply Bookmark Topic Watch Topic
  • New Topic

label is to be added only at a given position - the positions x,y coordinates given

 
scooter man
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!!
i m new in here and well new to the world of java , its my first assignment
i want to add a label to an applet - label is to be added only at the position where the mouse clicks, and this changes everytime the mouse is clicked
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"scooter man" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

To make your assignment work, you're going to have to do one of the things you should *never actually do* when developing GUIs in Java... use a null layout manager. You just pass "null" into the setLayout() method of the applet, then you have to use the setBounds() method on your label to set it's x, y, width, and height values.

Thanks! and welcome to the JavaRanch!
 
scooter man
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey thanx for the reply , but still dint quite get it , could u gimme an xample maybe to help me out - thanx anyways
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!