Examples of clearSelection()


Examples of javax.swing.ButtonGroup.clearSelection()

    JToggleButton viewBtn = new JToggleButton(IconUtils.createImageIcon(ICON_CLASS_PATH + "Cube.png"));
    this.logoLabel = new JLabel(IconUtils.createImageIcon(IMAGE_CLASS_PATH + "xgenerator.png"));
    this.logoLabel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
        buttonGroup.clearSelection();
        logoLabel.requestFocusInWindow();
      }
    });
   
    homeBtn.setText("首页");
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

  {
    DefaultListSelectionModel m = new DefaultListSelectionModel();
    harness.check(m.isSelectedIndex(99), false);
    m.addSelectionInterval(99, 99);
    harness.check(m.isSelectedIndex(99), true);
    m.clearSelection();
    harness.check(m.isSelectedIndex(99), false);
   
    // try a negative index
    harness.check(m.isSelectedIndex(-1), false);
    harness.check(m.isSelectedIndex(-2), false);
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

    harness.check(m2.isSelectedIndex(5), true);
    harness.check(m2.isSelectedIndex(9), true);
    harness.check(m2.isSelectedIndex(10), false);
   
    // confirm that m1 and m2 are independent
    m2.clearSelection();
    harness.check(m2.isSelectionEmpty(), true);
    harness.check(m1.isSelectionEmpty(), false);
   
    // confirm that m2 doesn't have any listeners
    ListSelectionListener[] listeners = m2.getListSelectionListeners();
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

  {
    DefaultListSelectionModel m = new DefaultListSelectionModel();
    harness.check(m.getMinSelectionIndex(), -1);
    m.addSelectionInterval(99, 101);
    harness.check(m.getMinSelectionIndex(), 99);
    m.clearSelection();
    harness.check(m.getMinSelectionIndex(), -1);
  }
}
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

    harness.check(m.isSelectedIndex(1), true);
    harness.check(m.isSelectedIndex(2), true);
    harness.check(m.isSelectedIndex(3), false);
   
    // check what happens for negative indices...
    m.clearSelection();
    m.addSelectionInterval(-1, 1);
    harness.check(m.isSelectedIndex(-2), false);
    harness.check(m.isSelectedIndex(-1), false);
    harness.check(m.isSelectedIndex(0), false);
    harness.check(m.isSelectedIndex(1), false);
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

  {
    DefaultListSelectionModel m = new DefaultListSelectionModel();
    harness.check(m.isSelectionEmpty(), true);
    m.addSelectionInterval(99, 99);
    harness.check(m.isSelectionEmpty(), false);
    m.clearSelection();
    harness.check(m.isSelectionEmpty(), true);
  }
}
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

    harness.check(m.getMinSelectionIndex(), 3);
    harness.check(lastEvent.getSource(), m);
    harness.check(lastEvent.getFirstIndex(), 3);
    harness.check(lastEvent.getLastIndex(), 3);
   
    m.clearSelection();
    m.addSelectionInterval(3, 1);
    harness.check(m.isSelectedIndex(0), false);
    harness.check(m.isSelectedIndex(1), true);
    harness.check(m.isSelectedIndex(2), false);
    harness.check(m.isSelectedIndex(3), false);
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

    harness.check(m.getMinSelectionIndex(), 3);
    harness.check(lastEvent.getSource(), m);
    harness.check(lastEvent.getFirstIndex(), 3);
    harness.check(lastEvent.getLastIndex(), 8);
   
    m.clearSelection();
    m.addSelectionInterval(3, 1);
    harness.check(m.isSelectedIndex(0), false);
    harness.check(m.isSelectedIndex(1), true);
    harness.check(m.isSelectedIndex(2), true);
    harness.check(m.isSelectedIndex(3), true);
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

    harness.check(m.isSelectedIndex(1), true);
    harness.check(m.isSelectedIndex(2), true);
    harness.check(m.isSelectedIndex(3), true);
    harness.check(m.isSelectedIndex(4), false);
   
    m.clearSelection();
    m.addSelectionInterval(2, 1);
    harness.check(m.isSelectedIndex(0), false);
    harness.check(m.isSelectedIndex(1), true);
    harness.check(m.isSelectedIndex(2), true);
    harness.check(m.isSelectedIndex(3), false);
View Full Code Here

Examples of javax.swing.DefaultListSelectionModel.clearSelection()

    // clearing an empty selection generates no event
    harness.checkPoint("SINGLE_SELECTION (1)");
    DefaultListSelectionModel m = new DefaultListSelectionModel();
    m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    m.addListSelectionListener(this);
    m.clearSelection();
    harness.check(lastEvent, null);
   
    harness.checkPoint("SINGLE_SELECTION (2)");
    m.setSelectionInterval(3, 3);
    lastEvent = null;
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.