All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.awt.Header

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----com.sun.wizards.awt.Header

public class Header
extends Canvas
The Header object displays a banner of text. The banner has a default background of blue, and a default foreground of white.

Graphic of Header displaying text.

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());
       add(new Header("Header Text"), "North");
     }
 }
 


Constructor Index

 o Header()
Constructs a Header object with no text.
 o Header(String)
Constructs a Header object with the specified text.

Method Index

 o getMinimumSize()
Returns the minimum size of this header object.
 o getPreferredSize()
Returns the preferred size of this header object.
 o getText()
Returns the text currently being displayed in the header.
 o paint(Graphics)
Paints this header object using the specified Graphics object.
 o setText(String)
Sets the text to be displayed in the header.

Constructors

 o Header
 public Header()
Constructs a Header object with no text.

 o Header
 public Header(String headerText)
Constructs a Header object with the specified text.

Parameters:
headerText - The text to be displayed in the new Header object.

Methods

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

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

Parameters:
headerText - The desired text for the header.
 o paint
 public void paint(Graphics g)
Paints this header object using the specified Graphics object.

Parameters:
g - The Graphics object used to paint the Header.
Overrides:
paint in class Canvas
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size of this header object.

Returns:
The preferred size.
Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size of this header object.

Returns:
The minimum size.
Overrides:
getMinimumSize in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index