Example usage for javax.swing BorderFactory createLoweredSoftBevelBorder

List of usage examples for javax.swing BorderFactory createLoweredSoftBevelBorder

Introduction

In this page you can find the example usage for javax.swing BorderFactory createLoweredSoftBevelBorder.

Prototype

public static Border createLoweredSoftBevelBorder() 

Source Link

Document

Creates a beveled border with a lowered edge and softened corners, using brighter shades of the component's current background color for highlighting, and darker shading for shadows.

Usage

From source file:Main.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("Justified Titled Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    Border loweredBorder = BorderFactory.createLoweredSoftBevelBorder();
    JButton loweredButton = new JButton("Lowered");
    loweredButton.setBorder(loweredBorder);

    Container contentPane = frame.getContentPane();
    contentPane.add(loweredButton);/*from w w  w . j  av a 2s . c  o m*/
    frame.setSize(300, 200);
    frame.setVisible(true);

}

From source file:Test.java

public Test() {
    this.setBounds(100, 100, 200, 100);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createLoweredSoftBevelBorder());

    this.setLayout(new FlowLayout());

    JButton exitButton = new JButton("Exit");
    panel.add(exitButton);/*  w  w w  . j  av  a2 s .c  o m*/
    this.add(panel);

    exitButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent event) {
            System.exit(0);
        }
    });
}