Giter Site home page Giter Site logo

panelmatic's Introduction

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.

panelmatic's People

Contributors

michbarsinai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.