Netbeans GUI Builder with Java Swing; What's the easiest way to organize Widgets?

Use MigLayout. If you want to use pure Swing, use GridBagLayout and be prepared for a lot of pain.

I see. It looks like I have to hand code the layout. So, I'm assuming that "drag and drop" Swing in Netbeans does not work for big GUI projects?

The most efficient way is to use a layout manager, no? – Carlo del Mundo Aug 10 '10 at 14:54 NB should support visual editing of GridBagLayout but then, I do all my UI manually as well. It's just more simple in the end: I can define a couple of helper methods which build the UI the way I want with a few lines of code and when I need to change something, I know what happens.

– Aaron Digulla Aug 10 '10 at 15:19.

You are never forced to use a single layout manager. That is the problem with using an IDE to design a GUI. You get bloated code because the tool uses a single layout manager with multiple confusing constraints in order to get the form layout out the way you drag and drop it.

Create your forms manually and use nested panels with different layout managers to layout the components as desired. The code is easier to maintain and understand.

– Carlo del Mundo Aug 10 '10 at 15:17 IDE's provide more benefits then simply designing a form. They are great for debugging and so on, but I don't like to use them to generate code. The code is not portable between IDE's and you end up spending more time learning how to do something in the IDE rather than learning Java which can be applied in all environments.

– camickr Aug 10 '10 at 16:43.

Coding GUI manually should be the preferred way (at least for the sake of maintainability). There are a few, open source, Swing layout managers that are pretty good at it. Someone has mentioned MigLayout, which allows any layout, is quite simple to use, but often requires some tweaking until you get what you want.

On the other hand, you also can use DesignGridLayout, which is suitable for most common layouts and is easier to use (thanks to its fluent API) than MigLayout.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions