Flat CheckBox : CheckBox Button « Swing JFC « Java

Flat CheckBox

Flat CheckBox
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.Border;

public class FlatCheckBox {
  public static void main(String args[]) {
    JFrame frame = new JFrame("Flat CheckBox Sample");
    JPanel panel = new JPanel(new GridLayout(0, 1));
    Border border = BorderFactory.createTitledBorder("Pizza Toppings");
    JCheckBox check = new JCheckBox("Anchovies");
    check = new JCheckBox("Garlic");
    check = new JCheckBox("Onions");
    check = new JCheckBox("Pepperoni");
    check = new JCheckBox("Spinach");
    JButton button = new JButton("Submit");
    Container contentPane = frame.getContentPane();
    contentPane.add(panel, BorderLayout.CENTER);
    contentPane.add(button, BorderLayout.SOUTH);
    frame.setSize(300, 200);


Related examples in the same category

1.JCheckBox is a widget that has two states. On and Off.
2.Swing CheckBoxesSwing CheckBoxes
3.CheckBox Demo 2CheckBox Demo 2
4. How to use the check box button How to use the check box button
5.CheckBox MnemonicCheckBox Mnemonic
6.Bad Checkbox UIBad Checkbox UI
7.React to menu action and checkbox menuReact to menu action and checkbox menu
8.Swing CheckBox DemoSwing CheckBox Demo
9.CheckBox Item ListenerCheckBox Item Listener
10.Icon CheckBox DemoIcon CheckBox Demo
11.Customizing the Icons in a JCheckBox Component
12.Customize these disabled icons
13.Set pressed icon
14.Display an icon when the cursor is moved over the checkbox. This is called the rollover icon.
15.Adding an Icon to the Label of a JCheckBox Component
16.Getting and Setting the State of a JCheckbox Component
17.Creating a JCheckbox Component
18.Check boxes with item changed event.
19.Get or set the selection state of JCheckBox
20.Customize JCheckBox icons
21.Radio button, ComboBoxRadio button, ComboBox
22.Using CheckBox ActionListener to controll font