is setBound()
the best way for setting the position of GUI? What are the other option and each own strength over the other? tnx

- 31,165
- 11
- 75
- 105

- 303
- 1
- 6
- 16
-
See all the good stuff in [this answer](http://stackoverflow.com/a/21180036/418556). Primarily the best approach is 'layouts' but that really only covers part of the story. – Andrew Thompson Jan 18 '14 at 03:59
3 Answers
Setting GUI elements by hand (absolute positioning) will cause nightmares if you ever try to modify anything in the future, and especially with different sized monitors. Look at the different layout managers that Swing/AWT offers, and utilize them to your advantage, and even combine multiple layouts to create the one you need (eg. flow layout inside a grid layout, which is in the east portion of a border layout).

- 1,540
- 2
- 17
- 23
is setBound the best way for setting the position of GUI?
Many here (myself included) feel that it's the worst way to do this as it leads you to create GUI's that are rigid, difficult to maintain and upgrade and look terrible on most platforms other than the one it was developed on.
what are the other option and each own strength over the other?
Check out the Swing layout manager tutorials and use the layout managers: Lesson: Laying Out Components Within a Container

- 283,665
- 25
- 256
- 373
-
1+1 Yes, layout managers alliw resizable guis where stuff automatically pisitions :) – Menelaos Jan 18 '14 at 03:12
**No...**
setBound() is not the best way to position your components. Because if you plan to change something in the future then you will not able to do this just like that or you have to change all the thing related to that component.
The best way to position your components is that use of Layout Managers. So try to use proper layout manager to position your components, so that it will not trouble you in the future

- 20,072
- 5
- 36
- 59