Re: when to call setBounds(), setLocation(), ...



Kova wrote:
I'm using BoxLayout and I can't get components to show as I want. I create components, do setBounds on them, make everything visible and it dosen't work!

When you use layout managers you should not use setBounds() or setSize(). You leave the calculation of the sizes and positions to the layout manager.

If things don't look as you like, you have

- Chosen the wrong combination of layout managers, and/or

- Not configured one or more of the used layout managers as desired.

Work through http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html
from start to end. Twice.

/Thomas

PS: If you get the "great hint" to use no layout manager or a null layout manager, ignore it. Layout managers are an essential part of AWT/Swing GUIs and you e.g. badly need them to compensate for cross-platform differences, dynamic resizing, internationalization, etc. Time spent to learn layout managers is time well spent.

--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
.