Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!