Subversion Repositories HomeAutomation

Rev

Go to most recent revision | Blame | Last modification | View Log | SVN | RSS feed

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