Search in sources :

Example 41 with LineBorder

use of javax.swing.border.LineBorder in project jdk8u_jdk by JetBrains.

the class ContrastMetalTheme method addCustomEntriesToTable.

@Override
public void addCustomEntriesToTable(UIDefaults table) {
    Border blackLineBorder = new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder = new BorderUIResource(new LineBorder(getWhite()));
    Object textBorder = new BorderUIResource(new CompoundBorder(blackLineBorder, new BasicBorders.MarginBorder()));
    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());
    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);
}
Also used : BorderUIResource(javax.swing.plaf.BorderUIResource) LineBorder(javax.swing.border.LineBorder) CompoundBorder(javax.swing.border.CompoundBorder) CompoundBorder(javax.swing.border.CompoundBorder) LineBorder(javax.swing.border.LineBorder) Border(javax.swing.border.Border)

Example 42 with LineBorder

use of javax.swing.border.LineBorder in project JMRI by JMRI.

the class PositionablePopupUtil method setBorderSize.

public void setBorderSize(int border) {
    borderSize = border;
    if (borderColor != null) {
        outlineBorder = new LineBorder(borderColor, borderSize);
        _parent.setBorder(new CompoundBorder(outlineBorder, borderMargin));
    //setHorizontalAlignment(CENTRE);
    }
    _parent.updateSize();
}
Also used : LineBorder(javax.swing.border.LineBorder) CompoundBorder(javax.swing.border.CompoundBorder)

Example 43 with LineBorder

use of javax.swing.border.LineBorder in project JMRI by JMRI.

the class PositionablePopupUtil method setMargin.

public void setMargin(int m) {
    margin = m;
    if (_parent.isOpaque()) {
        borderMargin = new LineBorder(getBackground(), m);
    } else {
        borderMargin = BorderFactory.createEmptyBorder(m, m, m, m);
    }
    if (_showBorder) {
        _parent.setBorder(new CompoundBorder(outlineBorder, borderMargin));
    }
    _parent.updateSize();
}
Also used : LineBorder(javax.swing.border.LineBorder) CompoundBorder(javax.swing.border.CompoundBorder)

Example 44 with LineBorder

use of javax.swing.border.LineBorder in project JMRI by JMRI.

the class PositionablePopupUtil method setBorder.

public void setBorder(boolean set) {
    _showBorder = set;
    if (set) {
        if (borderColor != null && _showBorder) {
            outlineBorder = new LineBorder(borderColor, borderSize);
            _parent.setBorder(new CompoundBorder(outlineBorder, borderMargin));
        }
    } else {
        _parent.setBorder(null);
    }
}
Also used : LineBorder(javax.swing.border.LineBorder) CompoundBorder(javax.swing.border.CompoundBorder)

Example 45 with LineBorder

use of javax.swing.border.LineBorder in project JMRI by JMRI.

the class PositionablePopupUtil method setBorderColor.

public void setBorderColor(Color border) {
    borderColor = border;
    if (borderColor != null && _showBorder) {
        outlineBorder = new LineBorder(borderColor, borderSize);
        _parent.setBorder(new CompoundBorder(outlineBorder, borderMargin));
    }
}
Also used : LineBorder(javax.swing.border.LineBorder) CompoundBorder(javax.swing.border.CompoundBorder)

Aggregations

LineBorder (javax.swing.border.LineBorder)59 Color (java.awt.Color)18 JPanel (javax.swing.JPanel)18 GridBagConstraints (java.awt.GridBagConstraints)16 GridBagLayout (java.awt.GridBagLayout)15 Insets (java.awt.Insets)13 JLabel (javax.swing.JLabel)12 ActionEvent (java.awt.event.ActionEvent)10 CompoundBorder (javax.swing.border.CompoundBorder)9 TitledBorder (javax.swing.border.TitledBorder)8 ActionListener (java.awt.event.ActionListener)7 JButton (javax.swing.JButton)7 JScrollPane (javax.swing.JScrollPane)7 Border (javax.swing.border.Border)7 Dimension (java.awt.Dimension)6 EmptyBorder (javax.swing.border.EmptyBorder)6 Point (java.awt.Point)4 MouseEvent (java.awt.event.MouseEvent)4 JCheckBox (javax.swing.JCheckBox)4 JComboBox (javax.swing.JComboBox)4