Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Moving Controls in the Applet at runtime

 
ajay chaturvedi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can i move awt-Swing controls in a applet at runtime. is any good example on the web?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Move them where? What do you mean exactly?
 
Dorothy Finkel-Laverty
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about something like this:
//to get the source of the object upon which the user has performed the action
Object source = e.getSource();
if (source == someObj)
someObj.setLocation(newXpos, newYpos);
You could also get the X & Y positions, and just increment by some value to have the component dance across the page.
 
ajay chaturvedi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to Move arround the controls within the applet and alow user to resize them just a we do a design time in some IDEs like Visual Age or Visual Basic for instens. Basically i wish to make an design time eviournment (studio) of somekind.
kindly help!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic