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);
}
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);
}
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);
}
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());
}
}
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());
}
}
Aggregations