Example usage for javax.swing BorderFactory createSoftBevelBorder

List of usage examples for javax.swing BorderFactory createSoftBevelBorder

Introduction

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

Prototype

public static Border createSoftBevelBorder(int type) 

Source Link

Document

Creates a beveled border of the specified type with 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 Main(String name) {
    getContentPane().setLayout(new FlowLayout());
    JLabel labelTwo = new JLabel("www.java2s.com");
    labelTwo.setBorder(BorderFactory.createSoftBevelBorder(BevelBorder.RAISED));

    add(labelTwo);/*w  ww. ja v  a  2  s . c  om*/

}

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.createSoftBevelBorder(BevelBorder.LOWERED));
    //  panel.setBorder(BorderFactory.createSoftBevelBorder(BevelBorder.RAISED));

    this.setLayout(new FlowLayout());

    JButton exitButton = new JButton("Exit");
    panel.add(exitButton);//  w  ww . j ava 2  s  .c o  m
    this.add(panel);

    exitButton.addActionListener(new ActionListener() {

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