why layout managers

I am wondering abt the need of layout managers when i have fixed size containers.I can might as well use a null layout and setBounds to all the child components. Please let me know if i am to consider anything else when taking a call whether or not use a layout manager. william

The problem with using a null layout and setbounds are many. But to name a few...

If your window is resized for any reason, your components won't adjust accordingly. So components might render off screen and the user won't see them.

Different OS's display components differently. A JButton of size 20x100 isn't the same size on Linux as it is on Windows. Also, the size could change just by using different L&F's. When you specify a location and size, it's not really pixals, cm, or any amount of measurement that is consistant.

Fonts - Similar to the affor mentioned problem, Fonts display differently on different OS's. So a static sized Component in Windows that displays the text "Push Me" might display "Push M.." in Linux.

I used to always use null layouts with setBounds(...) but I have been trying lately to use Layout Managers. Some of them are tricky at first but taking a day or 2 to learn them will save you days of headaches when the user calls and complains that the GUI looks funny on the OS at nnn X nnn resolution.

Originally posted by Gregg Bolinger: The problem with using a null layout and setbounds are many. But to name a few...

If your window is resized for any reason, your components won't adjust accordingly. So components might render off screen and the user won't see them.

Different OS's display components differently. A JButton of size 20x100 isn't the same size on Linux as it is on Windows. Also, the size could change just by using different L&F's. When you specify a location and size, it's not really pixals, cm, or any amount of measurement that is consistant.

Fonts - Similar to the affor mentioned problem, Fonts display differently on different OS's. So a static sized Component in Windows that displays the text "Push Me" might display "Push M.." in Linux.

I used to always use null layouts with setBounds(...) but I have been trying lately to use Layout Managers. Some of them are tricky at first but taking a day or 2 to learn them will save you days of headaches when the user calls and complains that the GUI looks funny on the OS at nnn X nnn resolution.

If you use the NullLayout adding new components to your forms can be a real nightmare. You have to manually update loads of your components to accomoadate the new one. This is easier if you use a gui builder but IMO you shouldnt use a gui builder for production code. Using layout managers makes adding/removing components easier. D.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com