Java LayoutManager: a LayoutManager search similar to GTK horizontal and vertical windows

Well, I messed up myself playing with GTK layouts, and now I started thinking about Windows layouts in terms of GTK and can't find a suitable LayoutManager to use.

I'm specifically looking for a LayoutManager, written in Java, for use in a Swing-based application that acts almost the same as GTK Horizontal and Vertical.

In particular, I want the child widgets to be tied to a size outside the axis of the container, as well as to the fact that some components take up additional space (the "expand" option in GTK), while other widgets accept only with a minimum size on the axis .

Is there a layout manager that will do this?

+3
source share
4 answers

In Java, the most custom layout manager is the GridBagLayout manager. It allows you to specify a position in the grid with gridxand gridyand how the extra space is distributed along this axis with weightxand weighty.

GridBagLayout is quite inconvenient, so I suggest reading the tutorial before using it , but I never found a layout that I could not build using GridBagLayout.

+1
source

. java, , , . Java, , , . , http://www.miglayout.com/. , , swing, .

+1

BoxLayout - Oracle - javax.swing.box BoxLayout.

.

0

Until I used GTK myself, as you describe it, it sounds like requirements to which I applied MSBLayout:

http://msblayout.sourceforge.net/javadoc/de/winterdrache/layout/MSBLayout.html

It combines the BoxLayout and GridBagLayout properties that other posters have talked about, but they are much easier to use.

0
source

All Articles