Results 1 to 5 of 5
- 01-30-2012, 04:05 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 8
- Rep Power
- 0
-
Re: Positioning objects within a JApplet.
It's usually not a good idea to set the exact position of components within a GUI. Rather you're much better off using layout managers and letting them set the component position and size for you.
- 01-30-2012, 04:42 AM #3
Member
- Join Date
- Jan 2012
- Posts
- 8
- Rep Power
- 0
Re: Positioning objects within a JApplet.
okay, but it is possible right? and if it was setting why does it not show up at all or sometimes stack at the top when i have the positions set?
-
Re: Positioning objects within a JApplet.
To do this, you must set the layout of the container that holds the components to null. If you do this, then you the programmer are fully responsible for setting the position and size of all components added to this container.
But having said this, while at first it seems easiest to make all layouts null and simply specify where each component should go, in the long run this will make creating and maintaining the GUI a nightmare. Image a complex GUI that holds 4 JRadioButtons in a column in the middle of the GUI. Now imagine that on revision you must add one more JRadioButton. This will mean not only setting it's position and size, but adjusting all components below and to the right of it with a huge risk of side effect. If on the other hand you used simple layouts nested in each other, you would only need one line of code with a minuscule risk of side effect.Last edited by Fubarable; 01-30-2012 at 04:55 AM.
- 01-30-2012, 04:56 AM #5
Member
- Join Date
- Jan 2012
- Posts
- 8
- Rep Power
- 0
Similar Threads
-
A componenet positioning problem
By apprerntice in forum AWT / SwingReplies: 10Last Post: 07-22-2011, 07:53 PM -
Vertical box and positioning
By aborgeld in forum New To JavaReplies: 9Last Post: 04-01-2011, 07:33 PM -
Positioning using setBounds
By thayalan in forum AWT / SwingReplies: 4Last Post: 04-28-2009, 01:59 AM -
JFrame to JApplet or JApplet to JApplet
By ramesh.8189 in forum AWT / SwingReplies: 13Last Post: 02-08-2009, 06:14 AM -
panel positioning
By shwein in forum New To JavaReplies: 4Last Post: 09-09-2008, 05:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks