use of javax.swing.border.EmptyBorder in project nhin-d by DirectProject.
the class EditorPanel method initUI.
protected void initUI() {
setLayout(new BorderLayout());
setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
policyText = new JTextArea();
policyText.setLineWrap(true);
policyText.setWrapStyleWord(true);
policyText.setEditable(true);
final JScrollPane scrollPane = new JScrollPane(policyText);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
fileNameLabel = new JLabel("*New File*");
final JPanel reportPanel = new JPanel(new BorderLayout());
reportPanel.add(fileNameLabel, BorderLayout.NORTH);
reportPanel.add(scrollPane, BorderLayout.CENTER);
//this.add(reportPanel, BorderLayout.CENTER);
validatePanel = new ValidatePanel();
validatePanel.setFeedMode(PolicyLexicon.SIMPLE_TEXT_V1, policyText.getDocument());
final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, reportPanel, validatePanel);
splitPane.setDividerLocation(400);
this.add(splitPane, BorderLayout.CENTER);
}
use of javax.swing.border.EmptyBorder 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.EmptyBorder 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());
}
}
use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.
the class JBTabbedPane method insertTab.
@Override
public void insertTab(String title, Icon icon, Component component, String tip, int index) {
super.insertTab(title, icon, component, tip, index);
//set custom label for correct work spotlighting in settings
JLabel label = new JLabel(title);
label.setIcon(icon);
label.setBorder(new EmptyBorder(1, 1, 1, 1));
setTabComponentAt(index, label);
updateSelectedTabForeground();
label.putClientProperty(LABEL_FROM_TABBED_PANE, Boolean.TRUE);
component.addHierarchyListener(this);
UIUtil.setNotOpaqueRecursively(component);
setInsets(component);
revalidate();
repaint();
}
use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.
the class FormBuilder method addTooltip.
public FormBuilder addTooltip(final String text) {
final JBLabel label = new JBLabel(text, UIUtil.ComponentStyle.SMALL, UIUtil.FontColor.BRIGHTER);
label.setBorder(new EmptyBorder(0, 10, 0, 0));
return addComponentToRightColumn(label, 1);
}
Aggregations