Subversion Repositories HomeAutomation

Rev

Rev 15 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 15 Rev 73
1
/**
1
/**
2
 * File created by Jimmy
2
 * File created by Jimmy
3
 * at 2003-dec-31 17:44:01
3
 * at 2003-dec-31 17:44:01
4
 */
4
 */
5
package Macbeth.Utilities;
5
package Macbeth.Utilities;
6
 
6
 
7
import javax.swing.*;
7
import javax.swing.*;
8
import java.awt.*;
8
import java.awt.*;
9
 
9
 
10
/**
10
/**
11
 * A title bar.
11
 * A title bar.
12
 * @author Jimmy
12
 * @author Jimmy
13
 */
13
 */
14
public class TitleBar extends JPanel {
14
public class TitleBar extends JPanel {
15
 
15
 
16
    protected JLabel titleLabel;
16
    protected JLabel titleLabel;
17
 
17
 
18
    public TitleBar(String title) {
18
    public TitleBar(String title) {
19
        setLayout(new BorderLayout());
19
        setLayout(new BorderLayout());
20
        setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
20
        setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
21
        setBorder(BorderFactory.createEmptyBorder());
21
        setBorder(BorderFactory.createEmptyBorder());
22
        setOpaque(true);
22
        setOpaque(true);
23
        titleLabel = new JLabel(title);
23
        titleLabel = new JLabel(title);
24
        titleLabel.setBorder(BorderFactory.createEmptyBorder(3,4,3,4));
24
        titleLabel.setBorder(BorderFactory.createEmptyBorder(3,4,3,4));
25
        add(BorderLayout.CENTER, titleLabel);
25
        add(BorderLayout.CENTER, titleLabel);
26
    }
26
    }
27
 
27
 
28
    public void setTitle(String title) {
28
    public void setTitle(String title) {
29
        titleLabel.setText(title);
29
        titleLabel.setText(title);
30
    }
30
    }
31
}
31
}
32
 
32