Example usage for javax.swing JCheckBox getModel

List of usage examples for javax.swing JCheckBox getModel

Introduction

In this page you can find the example usage for javax.swing JCheckBox getModel.

Prototype

public ButtonModel getModel() 

Source Link

Document

Returns the model that this button represents.

Usage

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setMnemonic((char) 'H');

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);/*from  ww w  .j a v a 2s  . c  o m*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setSelected(true);

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);/*from  w  ww.  j av  a2s  .com*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setPressed(true);

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);//from   ww w .  ja  va2s.co  m
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setRollover(true);

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);/*from  ww w  .j  a  va  2  s  .  co m*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setArmed(false);

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);/*from  w ww.  ja  v  a 2s  .  com*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setEnabled(false);

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);/* w w  w  .ja v  a2 s . c  o m*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setActionCommand("Hi");

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);//from w  w w .  ja  v a  2s  . c  om
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setMnemonic((char) 'H');
    System.out.println(checkBox.getModel().getMnemonic());

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);/*w w  w. j av a  2s  .  c om*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setEnabled(false);
    System.out.println(checkBox.getModel().isEnabled());

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);//www .  ja va 2  s .  c  o  m
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] a) {
    JFrame frame = new JFrame("Selecting CheckBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JCheckBox checkBox = new JCheckBox("Hi");

    checkBox.getModel().setEnabled(false);
    System.out.println(checkBox.getModel().isRollover());

    frame.add(checkBox, BorderLayout.NORTH);
    frame.setSize(300, 100);/*from   w  w  w  .j  a  va 2s.  c  om*/
    frame.setVisible(true);
}