Package ca.corbett.forms
package ca.corbett.forms
Welcome to swing-forms!
The swing-forms library provides a layer of abstraction on top of Java Swing components, and in particular eliminates the need to worry about a LayoutManager for forms-like interfaces - that is, presenting a group of related input fields to the user to allow for viewing and modification.Online documentation
In addition to the javadocs that you are reading right now, the swing-forms library is also well documented in the swing-extras book, which is available online.Quick guide to the code
Here is a very quick overview of the code:- The FormPanel class wraps a collection of FormField instances and gives you an easy way to display them, allow user input, and provide form validation before accepting the new values.
- The FormField class provides an abstract starting point for the various FormField implementations. Generally speaking, each FormField implementing class wraps a different Java Swing UI component.
- The FieldValidator interface provides a starting point for form field validation. A few FieldValidator implementations are included out of the box for some basic validation, or you can very easily build your own FieldValidator implementation.
Extending the code
The swing-forms library is designed with extensibility in mind! If you need a new type of FormField, you can either create a PanelField and add whatever components you need into it, or you can extend FormField and write your own custom FormField. If you need custom validation rules for your input form or for a particular FormField, you can easily extend FieldValidator to write whatever validation rules you need.Additional help
You can fire up the included swing-extras demo app for a quick walk-through of some of the capabilities of swing-forms.You can refer to the swing-extras book for additional documentation and examples.
You can visit the project issues page on GitHub to view the existing issues or to post a question.
Have fun!
Say goodbye forever to writing niggly GridBagLayout code, and enjoy bringing your forms to the screen quickly and painlessly!- Author:
- scorbo2
-
ClassDescriptionUseful for FormPanel alignment, to decide how to lay out controls within a FormPanel.Represents a dialog that can be shown to the user to allow selection of a font with style properties and optional foreground/background color selection.FormPanel wraps a collection of FormFields and manages the following functions: Layout management - you don't need to write manual GridBagLayout code to use a FormPanel.Can be used to specify margins around an inside of a FormField.Centralizes and manages access to the various resource images that are used in swing-forms.