List of utility methods to do Swing TitledBorder
void | addMarginBorder(JPanel panel, String title, int top, int left, int bottom, int right) add Margin Border Border border = BorderFactory.createTitledBorder(title); Border marginBorder = new EmptyBorder(top, left, bottom, right); panel.setBorder(new CompoundBorder(marginBorder, border)); |
void | borderTitle(JComponent component, String title) border Title component.setBorder(BorderFactory.createTitledBorder(title)); |
JComponent | buildInfoPanelTextBorder(final JLabel content, final String title) build Info Panel Text Border content.setHorizontalAlignment(SwingConstants.CENTER);
content.setVerticalAlignment(SwingConstants.CENTER);
content.setOpaque(true);
return buildInfoPanelTextBorder((JComponent) content, title);
|
JComponent | buildInfoPanelTextBorderScroll(final JComponent content, final String title) build Info Panel Text Border Scroll final JPanel result = new JPanel(new BorderLayout()); result.setBorder(BorderFactory.createTitledBorder(title)); final JScrollPane scroll = new JScrollPane(content); result.add(scroll, BorderLayout.CENTER); return result; |
Border | buildLabeledBorder(String label) build Labeled Border TitledBorder ret = new TitledBorder(new EtchedBorder(), label); return ret; |
Border | createBorder() create Border return BorderFactory.createEmptyBorder(4, 4, 4, 4);
|
Border | createBorder(String message) Default look and feel titled border used in all interfaces. return new TitledBorder(new EtchedBorder(), message, 1, 2, messageTextFont); |
Border | createBorder(String title) Creates titled JPanel Borders return BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), title);
|
Border | createBorder(String title) create Border return BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3),
BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(title),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
|
JPanel | createBorderedPanel(String title, int margin) Create a bordered panel. final JPanel panel = new JPanel(); final Border outside = BorderFactory.createTitledBorder(title); final Border inside = BorderFactory.createEmptyBorder(margin, margin, margin, margin); panel.setBorder(BorderFactory.createCompoundBorder(outside, inside)); return panel; |