An intuitive library for creating complex Java Swing layouts.
PanelMatic is a mature Swing helper library, created to allow easy creation of complex, high-quality layouts. A panels can be created using a single expression, whose structure directly relates to the way said panel looks.
PanelMatic It is highly customizable, supports right-to-left layouts, and provides an easy way of adding uniform listeners to panel components. The latter is useful, e.g., when one wants any change in a set of text fields to enable a "save" button.
đź’ˇ
|
A PanelMatic intro is available at mbarsinai.com. Many panel examples are available at the Examples directory at the project’s tests. |
The below diagram suggests which classes are more important for client code, and which could be safely ignored.
The following examples show how PanelMatic’s fluent API allows creation of a panel using a single expression.
System.out.println("A panel with two JLabels would "
+ "have a preferred height of "
+ PanelMatic.begin()
.add( new JLabel("Label 1"))
.add( new JLabel("Label 2"))
.get()
.getPreferredSize().height
+ " pixels.");
output:
A panel with two JLabels would have a preferred height of 40 pixels.
Add the following to your pom.xml
:
<dependencies>
<dependency>
<groupId>io.codeworth</groupId>
<artifactId>PanelMatic</artifactId>
<version>0.9.8</version>
</dependency>
...
</dependencies>
-
Download from the releases page. PanelMatic does not have any external dependencies.