0

hi every body!

i set the Layout to be null

setLayout(null);

.
when i resize the window, components do not resize.

if there any code that i can write to solve my problem?

please help!

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by karyal
2

Using a null layout manager is usually a mistake - layout managers are there for good reasons (different system font sizes on different machines, different screen resolutions, user-resizable windows...). This trick is to chose the simplest layout manager that does what you need. That usually means BorderLayout, FlowLayout, BoxLayout, or GridLayout. Remember a Panel can have a different layout manager from the frame that its in.
Here's a good place to start:
http://download.oracle.com/javase/tu...ut/visual.html

0

i do appreciate your reply!

i setBounds of each component!

I've tried layout managers, it works!. however, they do not provide absolute positioning there were no freedom.

0

That depends on which layout manager you use. GridBagLayout can give you absolute pixel-level positioning and sizing for everything (just like null manager), but still automatically handles changes in window size etc (unlike null manager). The choice is yours!

0

absolutely this is a kind of answer that i was looking for!

thank you very much!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.