Example usage for javax.swing BorderFactory createRaisedBevelBorder

List of usage examples for javax.swing BorderFactory createRaisedBevelBorder

Introduction

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

Prototype

public static Border createRaisedBevelBorder() 

Source Link

Document

Creates a border with a raised beveled edge, 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(String[] argv) {

    BevelBorder raisedBevelBorder = (BevelBorder) BorderFactory.createRaisedBevelBorder();
    JLabel component = new JLabel("label");
    component.setBorder(raisedBevelBorder);

}

From source file:ABevelBorder.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Bevel Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Border raisedBorder = BorderFactory.createRaisedBevelBorder();

    JButton button = new JButton("Raised");
    button.setBorder(raisedBorder);//from   ww  w  . ja va2s.  com
    frame.add(button);

    frame.setSize(300, 100);
    frame.setVisible(true);
}

From source file:MainClass.java

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);//from   ww w  . j  a  v  a2  s  .co  m
    frame.setSize(300, 200);
    frame.setVisible(true);

}

From source file:ABevelBorder.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Bevel Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Border raisedBorder = BorderFactory.createRaisedBevelBorder();
    Border loweredBorder = BorderFactory.createLoweredBevelBorder();
    Border myRaisedBorder = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.pink, Color.red);
    Border myLoweredBorder = BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.pink, Color.red);
    JButton raisedButton = new JButton("Raised");
    raisedButton.setBorder(raisedBorder);
    JButton loweredButton = new JButton("Lowered");
    loweredButton.setBorder(loweredBorder);
    JButton myRaisedButton = new JButton("My Raised");
    myRaisedButton.setBorder(myRaisedBorder);
    JButton myLoweredButton = new JButton("My Lowered");
    myLoweredButton.setBorder(myLoweredBorder);
    Container contentPane = frame.getContentPane();
    contentPane.setLayout(new GridLayout(2, 2, 5, 5));
    contentPane.add(raisedButton);/*from   w  ww  .  j  a va  2s  .com*/
    contentPane.add(loweredButton);
    contentPane.add(myRaisedButton);
    contentPane.add(myLoweredButton);
    frame.setSize(300, 100);
    frame.setVisible(true);
}

From source file:ACompoundBorder.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Compound Borders");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Border lineBorder = LineBorder.createBlackLineBorder();
    Border bevelBorder = BorderFactory.createRaisedBevelBorder();
    Border bevelLineBorder = new CompoundBorder(bevelBorder, lineBorder);
    JButton bevelLineButton = new JButton("Bevel Line");
    bevelLineButton.setBorder(bevelLineBorder);
    Border redBorder = BorderFactory.createLineBorder(Color.MAGENTA, 2);
    Border orangeBorder = BorderFactory.createLineBorder(Color.BLUE, 2);
    Border yellowBorder = BorderFactory.createLineBorder(Color.YELLOW, 5);
    Border greenBorder = BorderFactory.createLineBorder(Color.GREEN, 2);
    Border blueBorder = BorderFactory.createLineBorder(Color.ORANGE, 4);
    Border magentaBorder = BorderFactory.createLineBorder(Color.RED, 3);
    Border twoColorBorder = new CompoundBorder(magentaBorder, blueBorder);
    Border threeColorBorder = new CompoundBorder(twoColorBorder, greenBorder);
    Border fourColorBorder = new CompoundBorder(threeColorBorder, yellowBorder);
    Border fiveColorBorder = new CompoundBorder(fourColorBorder, orangeBorder);
    Border sixColorBorder = new CompoundBorder(fiveColorBorder, redBorder);
    JButton rainbowButton = new JButton("Rainbow");
    rainbowButton.setBorder(sixColorBorder);
    Container contentPane = frame.getContentPane();
    contentPane.setLayout(new GridLayout(1, 2));
    contentPane.add(bevelLineButton);/*from   w w w  .  ja v  a  2s  .c o m*/
    contentPane.add(rainbowButton);
    frame.setSize(300, 100);
    frame.setVisible(true);
}

From source file:ResourceModExample.java

public static void main(String[] args) {
    Border border = BorderFactory.createRaisedBevelBorder();
    Border tripleBorder = new CompoundBorder(new CompoundBorder(border, border), border);

    UIManager.put("Button.border", tripleBorder);

    UIManager.put("InternalFrame.closeIcon", new ImageIcon("close.gif"));
    UIManager.put("InternalFrame.iconizeIcon", new ImageIcon("iconify.gif"));
    UIManager.put("InternalFrame.maximizeIcon", new ImageIcon("maximize.gif"));
    UIManager.put("InternalFrame.altMaximizeIcon", new ImageIcon("altMax.gif"));

    UIManager.put("InternalFrame.titleFont", new Font("Serif", Font.ITALIC, 12));

    UIManager.put("ScrollBar.width", new Integer(30));

    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container c = f.getContentPane();

    JDesktopPane desk = new JDesktopPane();
    c.add(desk, BorderLayout.CENTER);

    JButton cut = new JButton("Cut");
    JButton copy = new JButton("Copy");
    JButton paste = new JButton("Paste");

    JPanel p = new JPanel(new FlowLayout());
    p.add(cut);/*from   ww  w . ja  v a2s  .com*/
    p.add(copy);
    p.add(paste);
    c.add(p, BorderLayout.SOUTH);

    JInternalFrame inf = new JInternalFrame("MyFrame", true, true, true, true);
    JLabel l = new JLabel(new ImageIcon("luggage.jpeg"));
    JScrollPane scroll = new JScrollPane(l);
    inf.setContentPane(scroll);
    inf.setBounds(10, 10, 350, 280);
    desk.add(inf);
    inf.setVisible(true);

    f.setSize(380, 360);
    f.setVisible(true);
}

From source file:TryGridBagLayout.java

static void addButton(String label, GridBagConstraints constraints, GridBagLayout layout) {
    Border edge = BorderFactory.createRaisedBevelBorder();
    JButton button = new JButton(label);
    button.setBorder(edge);// ww  w  . jav a 2  s.c om
    layout.setConstraints(button, constraints);
    aWindow.getContentPane().add(button);
}

From source file:Main.java

public Main() {
    JPanel simplePanel = new JPanel(new GridLayout(7, 1, 5, 5));

    simplePanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(),
            BorderFactory.createLoweredBevelBorder()));
    simplePanel.add(new JLabel("Examples"), JLabel.CENTER);

    add(simplePanel);//from  w  ww .  j  ava2  s .com
}

From source file:Main.java

public Main() {
    JPanel simplePanel = new JPanel(new GridLayout(7, 1, 5, 5));

    JLabel bevelRasBorderLabel = new JLabel("Raised Bevel Border", JLabel.CENTER);
    bevelRasBorderLabel.setBorder(BorderFactory.createRaisedBevelBorder());
    simplePanel.add(bevelRasBorderLabel);

    add(simplePanel);/*from  w  w w .j ava2s .c o m*/
}

From source file:BorderTest.java

public BorderTest() {
    JPanel p = new JPanel();
    Border[] border = new Border[] { BorderFactory.createEtchedBorder(),
            BorderFactory.createTitledBorder("Border types"), BorderFactory.createLoweredBevelBorder(),
            BorderFactory.createRaisedBevelBorder(), BorderFactory.createEtchedBorder(),
            BorderFactory.createLineBorder(Color.blue),
            BorderFactory.createMatteBorder(10, 10, 10, 10, Color.blue), BorderFactory.createEmptyBorder()

    };/*  ww w .  jav a 2 s.  c  o  m*/
    p.setLayout(new GridLayout(border.length, 0, 3, 3));

    for (int i = 0; i < border.length; i++) {
        JPanel borderPanel = new JPanel();
        borderPanel.setBorder(border[i]);
        p.add(borderPanel);
    }
    getContentPane().add(p, "Center");
    setTitle("BorderTest");
    setSize(600, 400);
    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });
}