How to set a button's position in an applet?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Henry_Leung
Posted On:   Thursday, September 12, 2002 11:35 PM

Can I set a button's position with exact (x,y) coordinate, just like when I draw something with the class Graphics?

Re: How to set a button's position in an applet?

Posted By:   Prashanth_Sukumaran  
Posted On:   Sunday, September 15, 2002 02:11 AM


Hi Henry,



Did you try the setBounds(Rectangle r) method. The Buttons new position is specified by r.x and r.y, and its new size is specified by r.width and r.height.



Also you need to set the Layout of the Panel where you are adding the button, to "null", but ofcourse you know the disadvantages of setting a null layout.




Prashanth Sukumaran.
About | Sitemap | Contact