Subversion Repositories HomeAutomation

Rev

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