blob: da162bb9e7ab79bd96e05e5452564dcaa1d2dd86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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);
}
}
|