Package javax.swing

Examples of javax.swing.JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem


      public void actionPerformed(ActionEvent evt)
      {
        System.out.println("MyAction");
      }
    };
    JCheckBoxMenuItem m = new JCheckBoxMenuItem(myAction);
    harness.check(m.getAction(), myAction);
    harness.check(m.isFocusable(), false);
  }
View Full Code Here


   * Constructor #4 Action specified as <code>null</code>.
   */
  public void testConstructor7(TestHarness harness)
  {
    Action myAction = null;
    JCheckBoxMenuItem m = new JCheckBoxMenuItem(myAction);
    harness.check(m.getAction(), null);
  }
View Full Code Here

   * Constructor #5 Label and Icon both specified.
   */
  public void testConstructor8(TestHarness harness)
  {
    ImageIcon i = new ImageIcon();
    JCheckBoxMenuItem m = new JCheckBoxMenuItem("Label", i);
    harness.check(m.getText(), "Label");
    harness.check(m.getIcon(), i);
    harness.check(m.getState(), false);
    harness.check(m.isFocusable(), false);
  }
View Full Code Here

  /**
   * Constructor #5 Label and Icon specifed as <code>null</code>.
   */
  public void testConstructor9(TestHarness harness)
  {
    JCheckBoxMenuItem m = new JCheckBoxMenuItem(null, null);
    harness.check(m.getText(), "");
    harness.check(m.getIcon(), null);
    harness.check(m.getState(), false);
  }
View Full Code Here

  /**
   * Constructor #6 Label and State both specified.
   */
  public void testConstructor10(TestHarness harness)
  {
    JCheckBoxMenuItem m = new JCheckBoxMenuItem("Label", true);
    harness.check(m.getText(), "Label");
    harness.check(m.getIcon(), null);
    harness.check(m.getState(), true);
    harness.check(m.isFocusable(), false);
  }
View Full Code Here

   * Constructor #6 Label specified as <code>null</code> and State specified
   * as <code>false</code>.
   */
  public void testConstructor11(TestHarness harness)
  {
    JCheckBoxMenuItem m = new JCheckBoxMenuItem(null, false);
    harness.check(m.getText(), "");
    harness.check(m.getIcon(), null);
    harness.check(m.getState(), false);
  }
View Full Code Here

   * Constructor #7 Label, Icon, and State specified.
   */
  public void testConstructor12(TestHarness harness)
  {
    ImageIcon i = new ImageIcon();
    JCheckBoxMenuItem m = new JCheckBoxMenuItem("Label", i, true);
    harness.check(m.getText(), "Label");
    harness.check(m.getIcon(), i);
    harness.check(m.getState(), true);
    harness.check(m.isFocusable(), false);
  }
View Full Code Here

   * Constructor #7 Label and Icon specified as <code>null</code> and State
   * specified as <code>false</code>.
   */
  public void testConstructor13(TestHarness harness)
  {
    JCheckBoxMenuItem m = new JCheckBoxMenuItem(null, null, false);
    harness.check(m.getText(), "");
    harness.check(m.getIcon(), null);
    harness.check(m.getState(), false);
  }
View Full Code Here

  /**
   * Testing default properties.
   */
  public void testDefaultProperties(TestHarness harness)
  {
    JCheckBoxMenuItem m = new JCheckBoxMenuItem("Label", new ImageIcon(), true);
    // Properties set by init method in JMenuItem.java.
    harness.check(m.isFocusPainted(), false);
    harness.check(m.getHorizontalAlignment(), JButton.LEADING);
    harness.check(m.getHorizontalTextPosition(), JButton.TRAILING);
    // Additional JMenuITem.java properties
    harness.check(m.getUIClassID(), "CheckBoxMenuItemUI");
    harness.check(m.getAccelerator(), null);
    harness.check(m.isArmed(), false);
    harness.check(m.isEnabled(), true);
    harness.check(m.isRequestFocusEnabled(), true);
    // Properties set by AbstractButton.java's constructor.
    harness.check(m.getHorizontalAlignment(), 10);
    harness.check(m.getHorizontalTextPosition(), 11);
    harness.check(m.getVerticalAlignment(), 0);
    harness.check(m.getVerticalTextPosition(), 0);
    harness.check(m.isBorderPainted(), true);
    harness.check(m.isContentAreaFilled(), true);
    harness.check(m.isFocusPainted(), false);
    harness.check(m.isFocusable(), false);
    harness.check(m.getAlignmentX(), 0.5f);
    harness.check(m.getAlignmentY(), 0.5f);
    harness.check(m.getDisplayedMnemonicIndex(), - 1);
    harness.check(m.isOpaque(), true);
    //Additional AbstractButton.java properties
    harness.check(m.getActionCommand(), "Label");
    harness.check(m.getMnemonic(), 0);
    harness.check(m.getMargin().top, 2);
    harness.check(m.getMargin().left, 2);
    harness.check(m.getMargin().bottom, 2);
    harness.check(m.getMargin().right, 2);
    harness.check(m.getPressedIcon(), null);
    harness.check(m.isRolloverEnabled(), false);
    harness.check(m.getRolloverIcon(), null);
    harness.check(m.getRolloverSelectedIcon(), null);
    harness.check(m.isSelected(), true);
    harness.check(m.getSelectedIcon(), null);
    // Properties set by JCheckBoxMenuItem.java constructor itself.
    harness.check(m.getModel() instanceof DefaultButtonModel);
    harness.check(m.getModel() != null);
    harness.check(m.isVisible(), true);
  }
View Full Code Here

public class getActionCommand extends
    gnu.testlet.javax.swing.AbstractButton.getActionCommand implements
    Testlet {

  public void test(TestHarness harness) {
    check(new JCheckBoxMenuItem("bla"), harness);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem

Copyright © 2018 www.massapicom. 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.