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
    Represents a FormField that can contain one or more buttons with configurable actions.
    A FormField to wrap a JCheckBox.
    Similar to PanelField, except this class gives you an "expand/contract" icon that allows the panel contents to be displayed or hidden.
     
    A FormField implementation for selecting a solid color.
    A FormField wrapping a JComboBox.
    A FormField for choosing a single directory or file.
    An example accessory component that can be supplied to the setAccessory method.
    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.
    The HtmlLabelField can be used to convert part of a label into a hyperlink, or which can be used to embed multiple separate hyperlinks within the same label.
    A FormField implementation that allows the user to select one or more images, and display them in a scrollable form field.
    A custom FormField implementation that allows editing of a single KeyStroke assignment.
    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.
     
    Represents a FormField that allows selection of a subset from a list.
    A FormField implementation specifically for long (multi-line) text input.
     
    A FormField implementation for viewing or editing a Margins instance.
    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 for password input.
    A FormField implementation specifically for short (single-line) text input.
    Wraps a JSlider and provides options for configuring it.
    Can be added to a FormField to receive notification when the FormField's value has changed.