Java Swing Tutorial - Java BorderFactory .createRaisedSoftBevelBorder ()








Syntax

BorderFactory.createRaisedSoftBevelBorder() has the following syntax.

public static Border createRaisedSoftBevelBorder()

Example

In the following code shows how to use BorderFactory.createRaisedSoftBevelBorder() method.

/*  w w  w.  ja  va2  s . c  om*/
import java.awt.Container;

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

public class Main {

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

    Border raisedBorder = BorderFactory.createRaisedSoftBevelBorder();
    JButton raisedButton = new JButton("Raised");
    raisedButton.setBorder(raisedBorder);

    
    Container contentPane = frame.getContentPane();
    contentPane.add(raisedButton);
    frame.setSize(300, 200);
    frame.setVisible(true);

  }
}