Free Java components, utilities and libraries

In this page you can find my collection of Java utilities, available to download for free, under a BSD-like license.

Table of contents

Swing components

Here are some swing components that you can use to improve your JFC/Swing experience.

JFontChooser

Something I've always missed in Java is a standard Font selection Dialog. My JFontChooser permits to select a font with minimum effort for both the user and the programmer, in a standard layout.

JFontChooser screenshot

Here is the source of a sample program, to learn how to use it.

JColorComboBox

Something I find handy to quickly select a color without opening a big and complex ColorChooser dialog box. My JColorComboBox permits to pick a color from a colored drop-down list.

JColorComboBox screenshot

Here is the source of a sample program, to learn how to use it.

Download

You can download:
To run the samples double-click the Jar file (or launch java -jar swing.jar).
Click here to browse the documentation on line.

Layout managers

Standard Java layout managers are very complicated but not so good even at simple tasks. I've developed some layout managers to ease GUI development.

MeshLayout

The MeshLayout is a better GridLayout. Something I hate of GridLayout is that all the cells of the grid have the same size. With MeshLayout every row of the grid will be as tall as the tallest component in the row, and every column will be as large as the largest component of the column. With this simple enhancement you can do something like this with a handful of lines of code:

MeshLayout screenshot

Here is the source of a sample program, to learn how to use it.
To better understand how it works see How to use MeshLayout.

PileLayout

PileLayout arrange components in a single row or in a single column. Constraint can be used to align components and to control their enlargement. With PileLayout you can do something like this with a handful of lines of code:

PileLayout screenshot

Here is the source of a sample program, to learn how to use it.
To better understand how it works see How to use PileLayout.

Download

You can download:
To run the samples double-click the Jar file (or launch java -jar layout.jar).
Click here to browse the documentation on line.

Contact

For any question, clarification, bug or typo, feel free to contact me by e-mail.

License

 /*
* Copyright © 2006, 2007 Roberto Mariottini. All rights reserved.
*
* Permission is granted to anyone to use this software in source and binary forms
* for any purpose, with or without modification, including commercial applications,
* and to alter it and redistribute it freely, provided that the following conditions
* are met:
*
* o Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* o The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* o Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/