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:48:26 |
3 | * at 2003-dec-31 17:48:26 |
| 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 | * Puts a title onto another control. |
11 | * Puts a title onto another control. |
| 12 | * @author Jimmy |
12 | * @author Jimmy |
| 13 | */ |
13 | */ |
| 14 | public class TitledControl extends JPanel { |
14 | public class TitledControl extends JPanel { |
| 15 | 15 | ||
| 16 | private Component component; |
16 | private Component component; |
| 17 | private TitleBar titleBar; |
17 | private TitleBar titleBar; |
| 18 | 18 | ||
| 19 | /** |
19 | /** |
| 20 | * Creates a new instance of TitledControl. |
20 | * Creates a new instance of TitledControl. |
| 21 | * @param component The component that you want to put a title on. |
21 | * @param component The component that you want to put a title on. |
| 22 | * @param title The title. |
22 | * @param title The title. |
| 23 | */ |
23 | */ |
| 24 | public TitledControl(Component component, String title) { |
24 | public TitledControl(Component component, String title) { |
| 25 | this.component = component; |
25 | this.component = component; |
| 26 | titleBar = new TitleBar(title); |
26 | titleBar = new TitleBar(title); |
| 27 | setLayout(new BorderLayout()); |
27 | setLayout(new BorderLayout()); |
| 28 | add(titleBar,BorderLayout.NORTH); |
28 | add(titleBar,BorderLayout.NORTH); |
| 29 | add(component,BorderLayout.CENTER); |
29 | add(component,BorderLayout.CENTER); |
| 30 | } |
30 | } |
| 31 | } |
31 | } |
| 32 | 32 | ||