Java BorderFactory .createSoftBevelBorder (int type)
Syntax
BorderFactory.createSoftBevelBorder(int type) has the following syntax.
public static Border createSoftBevelBorder(int type)
Example
In the following code shows how to use BorderFactory.createSoftBevelBorder(int type) method.
import java.awt.FlowLayout;
/* w w w . ja v a 2s . c om*/
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.border.BevelBorder;
public class Main extends JFrame {
public Main(String name) {
getContentPane().setLayout(new FlowLayout());
JLabel labelTwo = new JLabel("www.java2s.com");
labelTwo.setBorder(BorderFactory.createSoftBevelBorder(BevelBorder.RAISED));
add(labelTwo);
}
public static void main(String[] args) {
JFrame frame = new Main("javax.swing.JButton");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
Home »
Java Tutorial »
javax.swing »
Java Tutorial »
javax.swing »