BindingContext { public void adjustComponents() { for (Map.Entry<String, BindingImpl> entry : bindings.entrySet()) { entry.getValue().adjustComponents(); } } BindingContext();  BindingContext(PropertySet propertySet);  BindingContext(PropertySet propertySet, BindingProblemListener problemHandler); PropertySet getPropertySet(); boolean hasProblems(); BindingProblem[] getProblems(); void addProblemListener(BindingProblemListener listener); void removeProblemListener(BindingProblemListener listener); BindingProblemListener[] getProblemListeners(); void adjustComponents(); Binding getBinding(String propertyName); Binding bind(String propertyName, ComponentAdapter componentAdapter); void unbind(Binding binding); Binding bind(final String propertyName, final JTextComponent component); Binding bind(final String propertyName, final JTextField component); Binding bind(final String propertyName, final JFormattedTextField component); Binding bind(final String propertyName, final JCheckBox component); Binding bind(String propertyName, JRadioButton component); Binding bind(final String propertyName, final JList component, final boolean selectionIsValue); Binding bind(final String propertyName, final JSpinner component); Binding bind(final String propertyName, final JComboBox component); Binding bind(final String propertyName, final ButtonGroup buttonGroup); Binding bind(final String propertyName, final ButtonGroup buttonGroup,
                        final Map<AbstractButton, Object> valueSet); void addPropertyChangeListener(PropertyChangeListener l); void addPropertyChangeListener(String name, PropertyChangeListener l); void removePropertyChangeListener(PropertyChangeListener l); void removePropertyChangeListener(String name, PropertyChangeListener l); @SuppressWarnings({"MethodMayBeStatic"}) void permitPropertyChanges(JComponent component); @SuppressWarnings({"MethodMayBeStatic"}) void preventPropertyChanges(JComponent component); Enablement bindEnabledState(final String targetPropertyName,
                                       final boolean targetState,
                                       final String sourcePropertyName,
                                       final Object sourcePropertyValue); Enablement bindEnabledState(final String targetPropertyName,
                                       final boolean targetState,
                                       final Enablement.Condition condition); void setComponentsEnabled(String propertyName, boolean enabled);  }
@Test public void testAdjustComponents() throws Exception { JTextField textField1 = new JTextField(); JTextField textField2 = new JTextField(); JCheckBox checkBox = new JCheckBox(); pojo.booleanValue = true; pojo.doubleValue = 3.2; pojo.stringValue = "ABC"; bindingContextOB.bind("booleanValue", checkBox); bindingContextOB.bind("doubleValue", textField1); bindingContextOB.bind("stringValue", textField2); Thread.sleep(100); assertEquals(true, checkBox.isSelected()); assertEquals("3.2", textField1.getText()); assertEquals("ABC", textField2.getText()); pojo.booleanValue = false; pojo.doubleValue = 1.5; pojo.stringValue = "XYZ"; assertEquals(true, checkBox.isSelected()); assertEquals("3.2", textField1.getText()); assertEquals("ABC", textField2.getText()); bindingContextOB.adjustComponents(); Thread.sleep(100); assertEquals(false, checkBox.isSelected()); assertEquals("1.5", textField1.getText()); assertEquals("XYZ", textField2.getText()); }