1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.xmlhammer.gui.util;
24
25 import java.awt.Dimension;
26
27 import javax.swing.Box;
28 import javax.swing.JComboBox;
29 import javax.swing.JLabel;
30 import javax.swing.JToolBar;
31
32 /***
33 * Put comment...
34 *
35 * @version $Revision: 1.1 $, $Date: 2006/03/25 22:50:25 $
36 * @author Edwin Dankert <edankert@gmail.com>
37 */
38
39 public class TitleBar extends JToolBar {
40
41 private static final long serialVersionUID = 1L;
42
43 /***
44 *
45 * @param label
46 * @param combo
47 * @param background
48 */
49 public TitleBar( String label, JComboBox combo) {
50 super();
51
52 setRollover( true);
53 setFloatable( false);
54
55 JLabel l = new JLabel( label);
56
57 add( Box.createHorizontalStrut( 2));
58
59 if ( combo == null) {
60 JComboBox c = new JComboBox();
61 l.setPreferredSize( new Dimension( l.getPreferredSize().width, c.getPreferredSize().height));
62 }
63
64 add( l);
65
66 if ( combo != null) {
67 addSeparator();
68 combo.setMaximumSize( combo.getPreferredSize());
69 add( combo);
70 }
71
72 add( Box.createHorizontalGlue());
73 }
74
75 public TitleBar( String label) {
76 this( label, null);
77 }
78 }