Example usage for javax.swing JCheckBox setBorderPaintedFlat

List of usage examples for javax.swing JCheckBox setBorderPaintedFlat

Introduction

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

Prototype

@BeanProperty(visualUpdate = true, description = "Whether the border is painted flat.")
public void setBorderPaintedFlat(boolean b) 

Source Link

Document

Sets the borderPaintedFlat property, which gives a hint to the look and feel as to the appearance of the check box border.

Usage

From source file:FlatCheckBox.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Flat CheckBox Sample");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel(new GridLayout(0, 1));
    Border border = BorderFactory.createTitledBorder("Pizza Toppings");
    panel.setBorder(border);/*from  w w w .j a v a 2 s. co  m*/
    JCheckBox check = new JCheckBox("Anchovies");
    check.setBorderPaintedFlat(true);
    panel.add(check);
    check = new JCheckBox("Garlic");
    panel.add(check);
    check = new JCheckBox("Onions");
    check.setBorderPaintedFlat(true);
    panel.add(check);
    check = new JCheckBox("Pepperoni");
    panel.add(check);
    check = new JCheckBox("Spinach");
    check.setBorderPaintedFlat(true);
    panel.add(check);
    JButton button = new JButton("Submit");
    Container contentPane = frame.getContentPane();
    contentPane.add(panel, BorderLayout.CENTER);
    contentPane.add(button, BorderLayout.SOUTH);
    frame.setSize(300, 200);
    frame.setVisible(true);
}