Example usage for javax.swing BorderFactory createBevelBorder

List of usage examples for javax.swing BorderFactory createBevelBorder

Introduction

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

Prototype

public static Border createBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter,
        Color shadowInner) 

Source Link

Document

Creates a beveled border of the specified type, using the specified colors for the inner and outer highlight and shadow areas.

Usage

From source file:Main.java

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

    Border myRaisedBorder = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.PINK, Color.RED,
            Color.PINK, Color.RED);
    JButton myRaisedButton = new JButton("My Raised");
    myRaisedButton.setBorder(myRaisedBorder);

    Container contentPane = frame.getContentPane();
    contentPane.add(myRaisedButton);// w  ww. j  av  a  2  s. co  m
    frame.setSize(300, 200);
    frame.setVisible(true);

}

From source file:junk.gui.HazardSpectrumApplication.java

private void jbInit() throws Exception {
    border1 = BorderFactory.createLineBorder(SystemColor.controlText, 1);
    border2 = BorderFactory.createLineBorder(SystemColor.controlText, 1);
    border3 = BorderFactory.createEmptyBorder();
    border4 = BorderFactory.createLineBorder(SystemColor.controlText, 1);
    border5 = BorderFactory.createLineBorder(SystemColor.controlText, 1);
    border6 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white, Color.white,
            new Color(98, 98, 112), new Color(140, 140, 161));
    border7 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white, Color.white,
            new Color(98, 98, 112), new Color(140, 140, 161));
    border8 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white, Color.white,
            new Color(98, 98, 112), new Color(140, 140, 161));
    //this.getContentPane().setBackground(Color.white);
    this.setSize(new Dimension(1100, 670));
    this.getContentPane().setLayout(borderLayout1);

    jPanel1.setLayout(gridBagLayout10);/*from ww w .j a  v a  2  s.c o  m*/
    //creating the Object the GraphPaenl class
    graphPanel = new GraphPanel(this);

    jPanel1.setBackground(Color.white);
    jPanel1.setBorder(border4);
    jPanel1.setMinimumSize(new Dimension(959, 600));
    jPanel1.setPreferredSize(new Dimension(959, 600));

    //loading the OpenSHA Logo

    topSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    clearButton.setText("Clear Plot");
    clearButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            clearButton_actionPerformed(e);
        }
    });
    imgLabel.setText("");
    imgLabel.setIcon(new ImageIcon(FileUtils.loadImage(this.POWERED_BY_IMAGE)));
    imgLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            imgLabel_mouseClicked(e);
        }
    });
    //jCheckylog.setBackground(Color.white);
    //jCheckylog.setForeground(new Color(80, 80, 133));
    //buttonPanel.setBackground(Color.white);
    buttonPanel.setMinimumSize(new Dimension(568, 20));
    buttonPanel.setLayout(flowLayout1);
    //progressCheckBox.setBackground(Color.white);
    progressCheckBox.setFont(new java.awt.Font("Dialog", 1, 12));
    //progressCheckBox.setForeground(new Color(80, 80, 133));
    progressCheckBox.setSelected(true);
    progressCheckBox.setText("Show Progress Bar");
    addButton.setText("Compute");
    addButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            addButton_actionPerformed(e);
        }
    });
    // jCheckxlog.setBackground(Color.white);
    //jCheckxlog.setForeground(new Color(80, 80, 133));
    //controlComboBox.setBackground(new Color(200, 200, 230));
    //controlComboBox.setForeground(new Color(80, 80, 133));
    controlComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            controlComboBox_actionPerformed(e);
        }
    });
    panel.setLayout(gridBagLayout9);
    panel.setBackground(Color.white);
    panel.setBorder(border5);
    panel.setMinimumSize(new Dimension(0, 0));
    imrSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    imrSplitPane.setBottomComponent(imtPanel);
    imrSplitPane.setTopComponent(imrPanel);
    erfSplitPane.setTopComponent(erfPanel);
    sitePanel.setLayout(gridBagLayout13);
    sitePanel.setBackground(Color.white);
    imtPanel.setLayout(gridBagLayout8);
    imtPanel.setBackground(Color.white);
    controlsSplit.setDividerSize(5);
    erfPanel.setLayout(gridBagLayout5);
    erfPanel.setBackground(Color.white);
    erfPanel.setBorder(border2);
    erfPanel.setMaximumSize(new Dimension(2147483647, 10000));
    erfPanel.setMinimumSize(new Dimension(2, 300));
    erfPanel.setPreferredSize(new Dimension(2, 300));
    imrPanel.setLayout(gridBagLayout15);
    imrPanel.setBackground(Color.white);
    chartSplit.setLeftComponent(panel);
    chartSplit.setRightComponent(paramsTabbedPane);
    probDeterSelection.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            probDeterSelection_actionPerformed(e);
        }
    });
    peelOffButton.setText("Peel Off");
    peelOffButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
            peelOffButton_actionPerformed(e);
        }
    });
    this.getContentPane().add(jPanel1, BorderLayout.CENTER);
    jPanel1.add(topSplitPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(11, 4, 5, 6), 243, 231));
    buttonPanel.add(probDeterSelection, null);
    buttonPanel.add(controlComboBox, null);
    buttonPanel.add(addButton, null);
    buttonPanel.add(clearButton, null);
    buttonPanel.add(peelOffButton, null);
    buttonPanel.add(progressCheckBox, null);
    buttonPanel.add(imgLabel, null);
    topSplitPane.add(chartSplit, JSplitPane.TOP);
    chartSplit.add(panel, JSplitPane.LEFT);
    chartSplit.add(paramsTabbedPane, JSplitPane.RIGHT);
    imrSplitPane.add(imrPanel, JSplitPane.TOP);
    imrSplitPane.add(imtPanel, JSplitPane.BOTTOM);
    controlsSplit.add(imrSplitPane, JSplitPane.LEFT);
    paramsTabbedPane.add(controlsSplit, "IMR, IML/Prob, & Site");
    controlsSplit.add(sitePanel, JSplitPane.RIGHT);
    paramsTabbedPane.add(erfSplitPane, "ERF & Time Span");
    erfSplitPane.add(erfPanel, JSplitPane.LEFT);
    topSplitPane.add(buttonPanel, JSplitPane.BOTTOM);
    topSplitPane.setDividerLocation(600);
    imrSplitPane.setDividerLocation(300);
    erfSplitPane.setDividerLocation(260);
    controlsSplit.setDividerLocation(260);
    erfPanel.validate();
    erfPanel.repaint();
    chartSplit.setDividerLocation(600);

}