:: JGOODIES Looks :: Professional Swing Look&Feels

:: Guide :: View Adapters ::

Find below two lists that show the typical ways to bind single values and collections to Swing components. There are two convenience classes that assist in choosing the appropriate adapter and in binding a ValueModel to a Swing component:
  1. The BasicComponentFactory can create Swing components that are bound to a ValueModel; the factory chooses the appropriate adapter.
  2. The Bindings class is useful if you already have a component factory, or if you are using customized versions of the standard Swing components. the more basic Bindings class. It establishes the connection between a ValueModel and a given Swing component by setting the appropriate ValueModel adapter as the component's model.

Adapting Single Values

This table shows how to convert ValueModels to Swing component models. See also the ComponentsExample in the accompanying tutorial.

Component TypeAdapter / Connector
JCheckBoxToggleButtonAdapter
JCheckBoxMenuItemToggleButtonAdapter
JColorChooserColorSelectionAdapter
JFormattedTextFieldPropertyConnector
JLabelPropertyConnector
JPasswordFieldTextComponentConnector
JSliderBoundedRangeAdapter
JTextAreaTextComponentConnector
JTextFieldTextComponentConnector
JToggleButtonToggleButtonAdapter
JRadioButtonRadioButtonAdapter
JRadioButtonMenuItemRadioButtonAdapter

Adapting Collections

This table shows how to bind lists to JComboBox, JList and JTable. See also the MasterDetailsXXXExamples in the accompanying tutorial.

Component TypeAdapter / Connector
JComboBoxComboBoxAdapter on a ListModel or SelectionInList
JListSelectionInList or
ListModel
JTableAbstractTableAdapter wrapping a SelectionInList or
AbstractTableAdapter wrapping a ListModel or
Custom TableModel

(c) 2008 JGoodies