Package javax.swing

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()


  private ComboBoxModel createUnitModel()
  {
    final DefaultComboBoxModel model = new DefaultComboBoxModel(Unit.values());
    model.setSelectedItem(Unit.POINTS);
    model.addListDataListener(new UnitChangeListener());
    return model;
  }

  protected String getDialogId()
  {
View Full Code Here


  private ComboBoxModel createUnitModel()
  {
    final DefaultComboBoxModel model = new DefaultComboBoxModel(Unit.values());
    model.setSelectedItem(Unit.POINTS);
    model.addListDataListener(new UnitChangeListener());
    return model;
  }

  protected ComboBoxModel getUnitModel()
  {
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel();
    m.addListDataListener(this);
   
    m.insertElementAt("A", 0);
    harness.check(m.getSize(), 1);
    harness.check(m.getElementAt(0), "A");
    harness.check(m.getSelectedItem(), null);
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel(new Object[] {"A", "B", "C"});
    m.addListDataListener(this);
   
    m.removeElement("A");
    harness.check(m.getSize(), 2);
    harness.check(m.getElementAt(0), "B");
    harness.check(m.getSelectedItem(), "B");
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel();
    m.addListDataListener(this);
   
    m.addElement("A");
    harness.check(m.getSize(), 1);
    harness.check(m.getElementAt(0), "A");
    harness.check(m.getSelectedItem(), "A");
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel(new Object[] {"A", "B", "C"});
    m.addListDataListener(this);
   
    harness.check(m.getSize(), 3);
    harness.check(m.getSelectedItem(), "A");
   
    m.removeAllElements();
View Full Code Here

  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel(new Object[] {"A", "B",
            "C"});
    harness.check(m.getSelectedItem(), "A");
   
    m.addListDataListener(this);

    // first set the selected item to one of the elements in the list...
    m.setSelectedItem("C");
    harness.check(events.size(), 1);
    harness.check(m.getSelectedItem(), "C");
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel(new Object[] {"A", "B", "C"});
    m.addListDataListener(this);
   
    m.removeElementAt(0);
    harness.check(m.getSize(), 2);
    harness.check(m.getElementAt(0), "B");
    harness.check(m.getSelectedItem(), "B");
View Full Code Here

  {
    registry = new SequenceRegistry();
    setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    final DefaultComboBoxModel groupModel = new DefaultComboBoxModel(registry.getSequenceGroups(Locale.getDefault()));
    groupModel.addListDataListener(new SelectGroupAction());
    sequenceGroupBox = new JComboBox();
    sequenceGroupBox.setModel(groupModel);

    sequenceModel = new KeyedComboBoxModel<Sequence, String>();
    sequenceModel.addListDataListener(new SequenceSelectionHandler());
View Full Code Here

    classLoaderComboBox.setModel(classLoaderModel);
    classLoaderComboBox.setSelectedItem(factoryConfig.getClasspathId());

    updateConectionFactories();

    classLoaderModel.addListDataListener(new ListDataListener() {
      @Override
      public void contentsChanged(ListDataEvent e) {
        try {
          updateConectionFactories();
        } catch (Exception ex) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.