What java GUI layout manager does everyone use? Lately, I have been using MigLayout, which has some powerful component controls. Just wanted to see what other developers are using other than the standard JDK ones.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I started off using various nested layouts, then moved over to GridBagLayout (which is pretty frustrating). Since then I tried FormLayout (but found it wasn't suited to anything but forms) and settled firmly on TableLayout, which overall I'm very happy with.
Since then I've discovered MiGLayout and although I haven't done much more than play with it, it seems very capable, quite similar to TableLayout and probably a little cleaner.
The big plus for me is that MiGLayout is set to become part of the JDK, so I intend to use it pretty much exclusively when it does.
The other thing to remember is that no matter which heavy-weight LayoutManager you settle on, there is always a place for some of the simpler layout managers such as GridLayout. I've seen some horrible things done with GridBagLayout that could have been done much more easily with a simpler layout manager.
MiGLayout is the GUI layout manager which is widely used by Java Developers.
MiG and FormLayout (JGoodies) are both excellent for manual layout (And almost all layout eventually becomes manual). My biggest piece of advice is to design your views so that you can completely rip out the layout and re-implement it without impacting your application (good separation of view and controller is key here).
Definitely take a look at JGoodie's PresentationModel approach for implementing 'dumb' views. I use this technique with a GUI builder (I use GroupLayout with the Jigloo GUI builder plugin) for tossing off quick prototypes. After 3 or 4 iterations, that usually goes out the window and we do a re-implement using MiG or FormLayout.
EDIT: Since I wrote this, I have moved to using MiG for all of my layouts, and I no longer use a GUI builder - it's just way too easy to lay things out using MiG.
I use BorderLayout 90% of the time while nesting BoxLayout and SpringLayout