Search in sources :

Example 11 with TitledBorder

use of javax.swing.border.TitledBorder in project binnavi by google.

the class CVisibilityCriteriumPanel method initPanel.

/**
   * Creates the GUI of the panel.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Visibility Condition"));
    final JPanel comboPanel = new JPanel(new BorderLayout());
    comboPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    visibilityStateBox.addItem(VisibilityState.VISIBLE);
    visibilityStateBox.addItem(VisibilityState.UNVISIBLE);
    comboPanel.add(visibilityStateBox, BorderLayout.CENTER);
    mainPanel.add(comboPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 12 with TitledBorder

use of javax.swing.border.TitledBorder in project binnavi by google.

the class CProjectNodeComponent method createGui.

/**
   * Creates the elements of this component.
   */
private void createGui() {
    final JPanel topPanel = new JPanel(new BorderLayout());
    final JPanel innerTopPanel = new JPanel(new BorderLayout());
    innerTopPanel.add(m_stdEditPanel);
    topPanel.add(innerTopPanel);
    final JPanel debuggerChooserPanel = new JPanel(new BorderLayout());
    debuggerChooserPanel.setBorder(new TitledBorder("Project Debuggers"));
    m_checkedList = new JCheckedListbox<>(new Vector<DebuggerTemplate>(), false);
    updateCheckedListPanel();
    final JScrollPane debuggerScrollPane = new JScrollPane(m_checkedList);
    m_checkedListPanel.add(debuggerScrollPane);
    debuggerChooserPanel.add(m_checkedListPanel, BorderLayout.CENTER);
    debuggerChooserPanel.setMinimumSize(new Dimension(0, 128));
    debuggerChooserPanel.setPreferredSize(new Dimension(0, 128));
    innerTopPanel.add(debuggerChooserPanel, BorderLayout.SOUTH);
    final JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
    buttonPanel.setBorder(new EmptyBorder(0, 0, 5, 2));
    buttonPanel.add(new JPanel());
    buttonPanel.add(m_saveButton);
    topPanel.add(buttonPanel, BorderLayout.SOUTH);
    final JPanel bottomPanel = new CAddressSpacesTablePanel(m_table);
    final JScrollPane scrollPane = new JScrollPane(m_table);
    bottomPanel.setBorder(m_titledBorder);
    setBorder(new EmptyBorder(0, 0, 0, 1));
    bottomPanel.add(scrollPane);
    final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, topPanel, bottomPanel);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(splitPane.getMinimumDividerLocation());
    splitPane.setResizeWeight(0.5);
    add(splitPane);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder) JSplitPane(javax.swing.JSplitPane) Vector(java.util.Vector) CAddressSpacesTablePanel(com.google.security.zynamics.binnavi.Gui.FilterPanel.Default.CAddressSpacesTablePanel)

Example 13 with TitledBorder

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

the class Test4760089 method init.

@Override
public void init() {
    Border border = new EtchedBorder();
    border = new TitledBorder(border, "LEFT", TitledBorder.LEFT, TitledBorder.TOP);
    border = new TitledBorder(border, "RIGHT", TitledBorder.RIGHT, TitledBorder.TOP);
    JPanel panel = new JPanel();
    panel.setBorder(border);
    getContentPane().add(panel);
}
Also used : JPanel(javax.swing.JPanel) EtchedBorder(javax.swing.border.EtchedBorder) TitledBorder(javax.swing.border.TitledBorder) TitledBorder(javax.swing.border.TitledBorder) EtchedBorder(javax.swing.border.EtchedBorder) Border(javax.swing.border.Border)

Example 14 with TitledBorder

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

the class Test7022041 method checkTitleFont.

/**
      * Check behaviour of method TitledBorder.getTitleFont()
      */
private static void checkTitleFont() {
    TitledBorder titledBorder = new TitledBorder(new EmptyBorder(1, 1, 1, 1));
    Font defaultFont = UIManager.getLookAndFeelDefaults().getFont("TitledBorder.font");
    Font titledBorderFont = titledBorder.getTitleFont();
    // check default configuration
    if (defaultFont == null) {
        if (titledBorderFont == null) {
            return;
        } else {
            throw new RuntimeException("TitledBorder default font should be null");
        }
    }
    if (!defaultFont.equals(titledBorderFont)) {
        throw new RuntimeException("L&F default font " + defaultFont.toString() + " differs from TitledBorder font " + titledBorderFont.toString());
    }
    // title font is explicitly specified
    Font font = new Font("Dialog", Font.PLAIN, 10);
    titledBorder.setTitleFont(font);
    if (!font.equals(titledBorder.getTitleFont())) {
        throw new RuntimeException("TitledBorder font should be " + font.toString());
    }
    // title Font is unspecified
    titledBorder.setTitleFont(null);
    if (!defaultFont.equals(titledBorder.getTitleFont())) {
        throw new RuntimeException("L&F default font " + defaultFont.toString() + " differs from TitledBorder font " + titledBorderFont.toString());
    }
}
Also used : TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder) Font(java.awt.Font)

Example 15 with TitledBorder

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

the class Test7022041 method checkTitleColor.

/**
      * Check behaviour of method TitledBorder.getTitleColor()
      */
private static void checkTitleColor() {
    TitledBorder titledBorder = new TitledBorder(new EmptyBorder(1, 1, 1, 1));
    Color defaultColor = UIManager.getLookAndFeelDefaults().getColor("TitledBorder.titleColor");
    Color titledBorderColor = titledBorder.getTitleColor();
    // check default configuration
    if (defaultColor == null) {
        if (titledBorderColor == null) {
            return;
        } else {
            throw new RuntimeException("TitledBorder default color should be null");
        }
    }
    if (!defaultColor.equals(titledBorderColor)) {
        throw new RuntimeException("L&F default color " + defaultColor.toString() + " differs from TitledBorder color " + titledBorderColor.toString());
    }
    // title color is explicitly specified
    Color color = Color.green;
    titledBorder.setTitleColor(color);
    if (!color.equals(titledBorder.getTitleColor())) {
        throw new RuntimeException("TitledBorder color should be " + color.toString());
    }
    // title color is unspecified
    titledBorder.setTitleColor(null);
    if (!defaultColor.equals(titledBorder.getTitleColor())) {
        throw new RuntimeException("L&F default color " + defaultColor.toString() + " differs from TitledBorder color " + titledBorderColor.toString());
    }
}
Also used : Color(java.awt.Color) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

TitledBorder (javax.swing.border.TitledBorder)96 JPanel (javax.swing.JPanel)58 BorderLayout (java.awt.BorderLayout)30 GridBagConstraints (java.awt.GridBagConstraints)27 JLabel (javax.swing.JLabel)25 JScrollPane (javax.swing.JScrollPane)21 GridBagLayout (java.awt.GridBagLayout)20 Insets (java.awt.Insets)20 JButton (javax.swing.JButton)19 Dimension (java.awt.Dimension)18 EmptyBorder (javax.swing.border.EmptyBorder)18 GridLayout (java.awt.GridLayout)17 ActionEvent (java.awt.event.ActionEvent)17 ActionListener (java.awt.event.ActionListener)15 JCheckBox (javax.swing.JCheckBox)10 Color (java.awt.Color)9 Border (javax.swing.border.Border)9 FlowLayout (java.awt.FlowLayout)7 EtchedBorder (javax.swing.border.EtchedBorder)7 JTextField (javax.swing.JTextField)6