Package ca.corbett.forms.fields


package ca.corbett.forms.fields

ca.corbett.forms.fields

This package contains an abstract FormField class, along with some basic implementations. The FormField class itself is designed with extensibility in mind, so if there's a particular form field you need that isn't represented by one of these provided implementation classes, you can easily build your own by extending the FormField class. Use any of these provided implementation classes as a template to guide you in this process.

Responding to field changes

You can use FormField.addValueChangedListener() to register a listener which will be notified whenever the value in that FormField changes. This can allow you to make changes elsewhere on the form depending on what value is present in a given FormField. For example, field B should only be visible if field A has a certain value.

Validating FormFields

You can use FormField.addFieldValidator() to register a FieldValidator with a given FormField. This validator will be invoked when the form itself is validated, and the field will automatically show a validation success or failure label with a helpful tooltip.

Making cosmetic adjustments

You have options for changing the look of your forms. Each FormField has a Margins instance that can be used to offset or indent a FormField. Use FormField.getFieldLabel().setFont() to change the color or size or font face of the field label. All FormField implementing classes also expose the wrapped Java Swing UI component via getFieldComponent(), so you can apply custom styling to the individual form fields as well.
Author:
scorbo2
  • Class
    Description
    A FormField to wrap a JCheckBox.
    A FormField implementation for selecting a solid color.
    A FormField wrapping a JComboBox.
    A FormField for choosing a single directory or file.
    Currently supported selection modes for this field.
    A FormField implementation that provides the ability to select a Font, with optional abilities to select font size, font color, and font background color.
    FormField is an abstract base class which allows for the creation of a form field that wraps one or more Java Swing UI components.
    Represents a form field that just presents a static label without any user interaction.
    Wraps a JList to allow for multi-selection of some object type.
    A FormField implementation specifically for long (multi-line) text input.
     
    A FormField that wraps a JSpinner to allow numeric input.
    A FormField that wraps and exposes a JPanel, into which callers can render whatever extra custom components they want to display inline with the form.
    A FormField implementation specifically for short (single-line) text input.
    Can be added to a FormField to receive notification when the FormField's value has changed.