Skip to content

shannah/PanelMatic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PanelMatic

An intuitive library for creating complex Java Swing layouts.

layout to code to GUI process

Overview

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.

badge

javadocs browse green

💡

A PanelMatic intro is available at mbarsinai.com.

Many panel examples are available at the Examples directory at the project’s tests.

Sample Layouts (and the code that creates them)

login form
Figure 1. A simple login form
simple user data
Figure 2. A slightly more complex user profile panel
with another layout
Figure 3. PanelMatic panel used with Swing’s BorderLayout
combined builders
Figure 4. Nesting panels by nesting builders

Important Classes

The below diagram suggests which classes are more important for client code, and which could be safely ignored.

principle class diagram

Single Expression Panels

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.

Using PanelMatic in a Project

From Maven Central

Maven

Add the following to your pom.xml:

<dependencies>
    <dependency>
        <groupId>io.codeworth</groupId>
        <artifactId>PanelMatic</artifactId>
        <version>0.9.8</version>
    </dependency>
    ...
</dependencies>

sbt

Add the following to your build.sbt:

libraryDependencies += "io.codeworth" %% "PanelMatic" % "0.9.8"

As a .jar File

  • Download from the releases page. PanelMatic does not have any external dependencies.

Change Log

  • JavaDocs updated.

  • Initial Maven-based release, based on original release (which was based on Ant and subversion, and was managed on Kenai.com).

  • Updated in-repo documentation.

About

A Java Swing library for making high-quality complex layouts easy. And then some.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%