Package eu.bandm.tools.graficUtils
Class MultiLineFlowLayout
java.lang.Object
java.awt.FlowLayout
eu.bandm.tools.graficUtils.MultiLineFlowLayout
- All Implemented Interfaces:
LayoutManager
,Serializable
Needed for the contents of the option arguments JPanel.
This contents is a sequence of widgets for data input (or groups thereof!), and they should "flow" in the lines which make up a block in the right half of the top-level "grid-bag".
(The normal "FlowLayout" from javax.swing does not respect a maximum size, but makes the container above grow beyond all limits, so no line break would ever happen.)
This contents is a sequence of widgets for data input (or groups thereof!), and they should "flow" in the lines which make up a block in the right half of the top-level "grid-bag".
(The normal "FlowLayout" from javax.swing does not respect a maximum size, but makes the container above grow beyond all limits, so no line break would ever happen.)
WE FOUND THIS CODE SOMEWHERE IN THE NET, BUT REGRETTABLY DID NOT MEMORIZE. We tried to find it again (for reasons of acknowledgement), but failed. Sorry.
There is a similar code called "WrapLayout" by Rob Camick at https://tips4java.wordpress.com/2008/11/06/wrap-layout/ https://github.com/tips4java/tips4java/blob/main/source/WrapLayout.java
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
Call-back routine, must be overridden by the user to define the horizontal width of the layed-out container.minimumLayoutSize
(Container target) preferredLayoutSize
(Container target) Methods inherited from class java.awt.FlowLayout
addLayoutComponent, getAlignment, getAlignOnBaseline, getHgap, getVgap, layoutContainer, removeLayoutComponent, setAlignment, setAlignOnBaseline, setHgap, setVgap, toString
-
Constructor Details
-
MultiLineFlowLayout
protected MultiLineFlowLayout() -
MultiLineFlowLayout
protected MultiLineFlowLayout(int align)
-
-
Method Details
-
getPreferredLineWidth
public abstract int getPreferredLineWidth()Call-back routine, must be overridden by the user to define the horizontal width of the layed-out container. -
preferredLayoutSize
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
- Overrides:
preferredLayoutSize
in classFlowLayout
-
minimumLayoutSize
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
- Overrides:
minimumLayoutSize
in classFlowLayout
-