diff options
Diffstat (limited to 'src/uk/org/ury/frontend/FrontendSubBanner.java')
-rw-r--r-- | src/uk/org/ury/frontend/FrontendSubBanner.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/uk/org/ury/frontend/FrontendSubBanner.java b/src/uk/org/ury/frontend/FrontendSubBanner.java new file mode 100644 index 0000000..da162bb --- /dev/null +++ b/src/uk/org/ury/frontend/FrontendSubBanner.java @@ -0,0 +1,47 @@ +package uk.org.ury.frontend; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JTextArea; +import javax.swing.UIManager; + + +/** + * A banner, displaying a title, intended for use at the top of + * subsections. + * + * @author Matt Windsor + */ + +public class FrontendSubBanner extends JLabel +{ + private static final String TITLE_PREFIX = "<html><b>"; + private static final String TITLE_SUFFIX = "</b></html>"; + + + /** + * Construct a new FrontendSubBanner. + */ + + public + FrontendSubBanner () + { + super (); + + //setLineWrap (true); + //setWrapStyleWord (true); + //setEditable (false); + + setBackground (UIManager.getColor ("textHighlight")); + setForeground (UIManager.getColor ("textHighlightText")); + setBorder (BorderFactory.createEmptyBorder (3, 6, 3, 6)); + setOpaque (true); + } + + + public void + setText (String text) + { + super.setText (TITLE_PREFIX + text + TITLE_SUFFIX); + } +} |