BorderFactory: createRaisedBevelBorder() : BorderFactory « javax.swing « Java by API






BorderFactory: createRaisedBevelBorder()

 
import java.awt.Container;

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

public class MainClass {

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

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

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

  }
}
           
         
  








Related examples in the same category

1.BorderFactory: createBevelBorder(int type,Color highlight,Color shadow)
2.BorderFactory: createCompoundBorder(Border outsideBorder, Border insideBorder)
3.BorderFactory: createEtchedBorder()
4.BorderFactory: createEmptyBorder(int top,int left,int bottom,int right)
5.BorderFactory: createLineBorder(Color color)
6.BorderFactory: createLineBorder(Color color, int thickness)
7.BorderFactory: createLoweredBevelBorder()
8.BorderFactory: createMatteBorder(int top, int left, int bottom, int right, Color color)
9.BorderFactory.createTitledBorder(String text)
10.BorderFactory: createTitledBorder(Border b, String t, int j, int p)