All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.awt.HeaderPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----com.sun.wizards.awt.InsetsPanel
                                   |
                                   +----com.sun.wizards.awt.HeaderPanel

public class HeaderPanel
extends InsetsPanel
The HeaderPanel displays information in a Header banner. The HeaderPanel is used at the top of wizard panels to indicate the purpose of the panel. The header consits of a banner on a panel that is used to visually separate the header from the other contents occupying the panel.

Graphic of HeaderPanel.  The red region identifies its boundaries.

Here is the code for this applet:


 import java.applet.Applet;
 import java.awt.*;
 import com.sun.wizards.awt.*;
 public class Test extends Applet
 {
   public void init()
     {
       setLayout(new BorderLayout());
       HeaderPanel headerPanel = new HeaderPanel("Header Text");
       headerPanel.setBackground(Color.red);
       add(headerPanel, "North");
     }
 }
 


Constructor Index

 o HeaderPanel()
Constructs a new HeaderPanel object with no text in the banner.
 o HeaderPanel(String)
Constructs a new HeaderPanel object with the specified text in the banner.
 o HeaderPanel(String, Container)
Constructs a new HeaderPanel object with the specified text in the banner, and places the header panel at the top of the specified container.
 o HeaderPanel(String, Container, int)
Constructs a new HeaderPanel object with the specified text in the banner, and places the header panel at the top of the specified container, and sets the specified preferred height.

Method Index

 o getMinimumSize()
Returns the minimum size for this header panel.
 o getPreferredSize()
Returns the preferred size for this header panel.
 o getText()
Returns the text currently being displayed in the header panel.
 o setText(String)
Sets the text to be displayed in the header panel.

Constructors

 o HeaderPanel
 public HeaderPanel()
Constructs a new HeaderPanel object with no text in the banner.

 o HeaderPanel
 public HeaderPanel(String headerText)
Constructs a new HeaderPanel object with the specified text in the banner.

Parameters:
headerText - The text to be displayed in the banner.
 o HeaderPanel
 public HeaderPanel(String headerText,
                    Container parentContainer)
Constructs a new HeaderPanel object with the specified text in the banner, and places the header panel at the top of the specified container.

Parameters:
headerText - The text to be displayed in the banner.
parentContainer - The parent object on which this header will be displayed.
 o HeaderPanel
 public HeaderPanel(String headerText,
                    Container parentContainer,
                    int preferredHeight)
Constructs a new HeaderPanel object with the specified text in the banner, and places the header panel at the top of the specified container, and sets the specified preferred height.

Parameters:
headerText - The text to be displayed in the banner.
parentContainer - The parent object on which this header will be displayed.
preferredHeight - Preferred height of panel

Methods

 o getText
 public String getText()
Returns the text currently being displayed in the header panel.

 o setText
 public void setText(String headerText)
Sets the text to be displayed in the header panel.

Parameters:
headerText - The desired text for the header.
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size for this header panel.

Returns:
This HeaderPanel's preferred size.
Overrides:
getPreferredSize in class Container
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size for this header panel.

Returns:
This HeaderPanel's minimum size.
Overrides:
getMinimumSize in class Container

All Packages  Class Hierarchy  This Package  Previous  Next  Index