Example usage for javax.swing BorderFactory createLineBorder

List of usage examples for javax.swing BorderFactory createLineBorder

Introduction

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

Prototype

public static Border createLineBorder(Color color, int thickness) 

Source Link

Document

Creates a line border with the specified color and width.

Usage

From source file:CompoundBorderLabel.java

public CompoundBorderLabel() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    Border border1 = new CompoundBorder(LineBorder.createBlackLineBorder(),
            BorderFactory.createLineBorder(Color.red, 20));

    Border border2 = new CompoundBorder(border1, BorderFactory.createLoweredBevelBorder());

    label.setBorder(border2);/*from w  w  w.  j  a  va 2  s  .  c  o m*/
    getContentPane().add(label, BorderLayout.CENTER);
    pack();
}

From source file:SplashScreen.java

License:asdf

public SplashScreen(int d) {
    duration = d;//  w  w  w .  j av a  2s  . c om

    JPanel content = (JPanel) getContentPane();
    content.setBackground(Color.white);
    int width = 450;
    int height = 115;
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    int x = (screen.width - width) / 2;
    int y = (screen.height - height) / 2;
    setBounds(x, y, width, height);

    content.add(new JLabel("asdf"), BorderLayout.CENTER);
    Color oraRed = new Color(156, 20, 20, 255);
    content.setBorder(BorderFactory.createLineBorder(oraRed, 10));

    setVisible(true);
    try {
        Thread.sleep(duration);
    } catch (Exception e) {
    }
    setVisible(false);
}

From source file:Main.java

public CustomPanel(Color c) {
    setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),
            BorderFactory.createLineBorder(Color.black, 1)));

    setBackground(c);/*from  www.j ava 2s .  c om*/
}

From source file:SplashScreen.java

public void showSplash() {
    JPanel content = (JPanel) getContentPane();
    content.setBackground(Color.white);

    // Set the window's bounds, centering the window
    int width = 450;
    int height = 115;
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    int x = (screen.width - width) / 2;
    int y = (screen.height - height) / 2;
    setBounds(x, y, width, height);//  w  ww.j  ava 2  s  .c o  m

    // Build the splash screen
    JLabel label = new JLabel(new ImageIcon("1.gif"));
    JLabel copyrt = new JLabel("Copyright 2002, O'Reilly & Associates", JLabel.CENTER);
    copyrt.setFont(new Font("Sans-Serif", Font.BOLD, 12));
    content.add(label, BorderLayout.CENTER);
    content.add(copyrt, BorderLayout.SOUTH);
    Color oraRed = new Color(156, 20, 20, 255);
    content.setBorder(BorderFactory.createLineBorder(oraRed, 10));

    // Display it
    setVisible(true);

    // Wait a little while, maybe while loading resources
    try {
        Thread.sleep(duration);
    } catch (Exception e) {
    }

    setVisible(false);
}

From source file:rod_design_compute.ShowPanel.java

public ShowPanel(MainFrame parent) {
    initComponents();//from   w  w  w.  j a  v a  2  s  . co  m
    setBackground(Color.white);
    setBorder(BorderFactory.createLineBorder(Color.blue, (int) 2.0));
    this.parent = parent;
    originX = 100;
    originY = 560 - 100;
    ratio = 1.0;
    radiusBase = 5;
    lengthSlider = 200;
    lengthBlock = 50;
    radiusBaseDefault = 5;
    lengthSliderDefault = 200;
    lengthBlockDefault = 50;
    minDistance = 15;
    jLabelThu.setOpaque(true);
}

From source file:org.gvsig.gui.beans.graphic.GraphicChartPanel.java

/**
 * @return//from w  ww  .  jav  a2  s .c  om
 */
public ChartPanel getChart() {
    if (jPanelChart == null) {
        jPanelChart = new ChartPanel(chart);
        jPanelChart.setBorder(BorderFactory.createLineBorder(Color.gray, 1));
    }
    return jPanelChart;
}

From source file:org.executequery.gui.resultset.ResultSetTable.java

public ResultSetTable() {

    super();/*from   ww w. j  av  a  2 s  .c o m*/
    setDefaultOptions();

    final StringCellEditor stringCellEditor = new StringCellEditor();
    stringCellEditor.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1));
    defaultCellEditor = new DefaultCellEditor(stringCellEditor) {
        public Object getCellEditorValue() {
            return stringCellEditor.getValue();
        }
    };

    final MultiLineStringCellEditor multiLineStringCellEditor = new MultiLineStringCellEditor();
    multiLineStringCellEditor.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1));
    multiLineCellEditor = new DefaultCellEditor(multiLineStringCellEditor) {
        public Object getCellEditorValue() {
            return multiLineStringCellEditor.getValue();
        }
    };

}

From source file:org.drugis.addis.gui.StudyGraph.java

public StudyGraph(TreatmentDefinitionsGraphModel pm) {
    super(new BorderLayout());
    d_pm = pm;//from   w w w  .java  2 s.co  m

    d_vertexAttributes = new AttributeMap();
    CellConstants.setVertexShape(d_vertexAttributes, MultiLineVertexRenderer.SHAPE_RECTANGLE);
    CellConstants.setBackground(d_vertexAttributes, Color.WHITE);
    CellConstants.setForeground(d_vertexAttributes, Color.BLACK);
    CellConstants.setBorder(d_vertexAttributes, BorderFactory.createLineBorder(Color.BLACK, 2));
}

From source file:com.aw.swing.mvp.view.ViewManager.java

/**
 * Setting some default colors to the screens
 *///from   ww  w .j  ava2s .  c o  m
private void prepareView() {
    if (!(presenter instanceof FindPresenter)) {
        JPanel pnlToolBar = getIpView().getPnlToolBar();
        if (pnlToolBar != null) {
            pnlToolBar.setBackground(new Color(223, 232, 246));
            pnlToolBar.setBorder(BorderFactory.createLineBorder(new Color(131, 172, 219), 1));
        }
    }
}

From source file:org.monkeys.gui.matcher.MatcherPanel.java

public MatcherPanel() {
    initComponents();//from w  w w .j a  v  a2  s  . co  m
    wireEvents();
    this.clipboardDropdown.setModel(new DefaultComboBoxModel(ClipboardAction.values()));
    this.clipboardDropdown.setSelectedItem(ClipboardAction.LINE);
    this.editableText = this.textArea.getForeground();
    this.disabledText = Color.GRAY;
    this.modifyPopup = new PopupWindow(WindowManager.getDefault().getMainWindow(), this);
    this.modifyPopup.setPanel(this.modifyPanel);
    this.setBorder(BorderFactory.createLineBorder(Color.gray, 1));
}