java.lang.Object
com.jgoodies.binding.tutorial.basics.CommitStylesExample
- public final class CommitStylesExample
- extends java.lang.Object
Demonstrates three different styles when to commit changes:
on key typed, on focus lost, on OK/Apply pressed.
Therefore we bind 3 JTextFields to 3 String typed ValueModels
that honor the commit style. And we bind 3 JLabels directly
to these ValueModels that display the current value.
The ValueModels used in this example are requested from a
PresentationModel that adapts text properties of a TextBean.
This is just to demonstrate a consistent binding style.
The same techniques work with any ValueModel.
- Version:
- $Revision: 1.2 $
|
Constructor Summary |
CommitStylesExample()
Constructs the example with a PresentationModel on the a TextBean. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
presentationModel
private final PresentationModel presentationModel
- Holds a TextBean and vends ValueModels that adapt TextBean properties.
As an alternative to this PresentationModel we could use 3 ValueModels,
for example 3 ValueHolders, or any other ValueModel implementation.
onKeyTypedField
private javax.swing.text.JTextComponent onKeyTypedField
onFocusLostField
private javax.swing.text.JTextComponent onFocusLostField
onApplyField
private javax.swing.text.JTextComponent onApplyField
onKeyTypedLabel
private javax.swing.JLabel onKeyTypedLabel
onFocusLostLabel
private javax.swing.JLabel onFocusLostLabel
onApplyLabel
private javax.swing.JLabel onApplyLabel
applyButton
private javax.swing.JButton applyButton
CommitStylesExample
public CommitStylesExample()
- Constructs the example with a PresentationModel on the a TextBean.
main
public static void main(java.lang.String[] args)
initComponents
private void initComponents()
- Creates,binds and configures the UI components.
build
public javax.swing.JComponent build()
- Builds the pane.
buildButtonBar
private javax.swing.JComponent buildButtonBar()