Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are the Swing LayoutManagers adequate? [closed]

Tags:

java

layout

swing

I just had to add a checkbox to an application that was written before I got here, and it was way more difficult than it had to be because the app uses some third-party LayoutManager that attempts to do pseudo-absolute, gridlike positioning. The API was terrible, it takes position-designating strings that are comma-delimited lists of two, four, or six parameters (I still don't know why this varies), and I would much rather let the LayoutManager handle a lot of this grunt work, anyway. I've always felt like allowing Swing to position things itself led to better organization than anything I could generate. I felt the same way with CGI applications, where other than occasionally grouping checkboxes or radio boxes with tables I pretty much just let the browser flow and wrap things however the user wants.

Are the LayoutManager implementations included with Swing adequate, or is it really necessary to incorporate this kind of absolute control to force the layout to be exactly what you want (and give you a million more decisions to make)?

like image 732
skiphoppy Avatar asked Dec 02 '22 08:12

skiphoppy


1 Answers

This situation is getting a lot better. I would say the three most common non-standard layout managers are:

  • JGoodies FormLayout
  • TableLayout
  • MigLayout

The last two are pretty similar, but MigLayout came slightly later, and will be part of the JDK in future. I'd say any of the three have "standard" enough to use fairly comfortably, but MigLayout is likely to win out now it's to be part of Swing itself.

So at the moment, I'd say no. Once MigLayout's in the JDK, yes.

like image 187
Draemon Avatar answered Jan 19 '23 13:01

Draemon