I’m not sure how it is using other frameworks but this questions is strictly regarding Java swing.
Is it better to use a Visual Editor to place objects or to manually code the placement of the objects onto the frame (Layout managers or null layouts)?
From my experience I’ve had a lot of trouble using Visual editors when it comes to different screen resolutions or changing the window size. Using manual code to place objects I’ve found that my GUIs behave a lot better with regard to the screen size issue. However when I want to change a small part of my GUI it takes a lot more work compared to using a visual editor
Just wondering what people’s thoughts were on this?
I never use a visual builder for my Swing UIs.
The ease to build a new UI generally becomes a pain point during software maintenance: some builders can’t easily modify existing screens (in particular if they have been manually modified for some good reason); imposing a GUI builder to the people in charge of maintaining your software generally also means imposing their IDE as well, people may lack productivity if they have to use an IDE they are not used to or, worse, that they don’t like.
Of course, manually building UIs comes at a cost: understanding the complexity of various LayoutManagers. However, there is a broad range of Swing LayoutManagers out there (mostly open source), some being both easy to use (and maintain) and powerful.
Two examples:
all forms-like windows and is not
only easy to use (less than 1h to
understand and use) but also enforces
good looking UIs and is the only one
(that I am aware of) where you can
“visualize” the shape of your UIs by
just reading the java code.
a bit more complex to use and it
won’t prevent you to design ugly UIs
😉
One additional point: NEVER use absolute position/size in your UIs, this is looking for problems (your UIs may be truncated on some monitors/systems…)