All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.awt.FlowLabel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----com.sun.wizards.awt.FlowLabel
- public class FlowLabel
- extends Canvas
The FlowLabel is a simple text label that wraps
text into its container. Line breaks always
occur according to the line BreakIterator object.
Simple html-style commands are interpreted to achieve
bold and italics within the 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()
{
add(new FlowLabel("Flowlabel test: < bold >This is an example" +
" of bold text< /bold >. < italics >This is an" +
" example of italics text< /italics >."));
}
}
As the container is resized, the text will reflow to fit the container's
new width.
-
FlowLabel()
- Constructs a new FlowLabel with no text.
-
FlowLabel(String)
- Constructs a new FlowLabel with the specified
text.
-
getMinimumSize()
- Gets the minimum size of this component.
-
getPreferredSize()
- Gets the preferred size of this component.
-
paint(Graphics)
- Paints the contents of the FlowLabel.
-
setHgap(int)
- Sets the horizontal gap to the specified number of
pixels.
-
setText(String)
- Set the label text to the specified string.
-
setVgap(int)
- Sets the vertical gap to the specified number of
pixels.
FlowLabel
public FlowLabel()
- Constructs a new FlowLabel with no text.
FlowLabel
public FlowLabel(String text)
- Constructs a new FlowLabel with the specified
text.
- Parameters:
- text - The text for this label.
setHgap
public void setHgap(int hgap)
- Sets the horizontal gap to the specified number of
pixels.
- Parameters:
- hgap - The horizontal gap.
setVgap
public void setVgap(int vgap)
- Sets the vertical gap to the specified number of
pixels.
- Parameters:
- vgap - The vertical gap.
setText
public void setText(String text)
- Set the label text to the specified string.
- Parameters:
- text - The new text for this label.
getPreferredSize
public Dimension getPreferredSize()
- Gets the preferred size of this component.
- Returns:
- A dimension object indicating this component's preferred size.
- Overrides:
- getPreferredSize in class Component
getMinimumSize
public Dimension getMinimumSize()
- Gets the minimum size of this component.
- Returns:
- A dimension object indicating this component's minimum size.
- Overrides:
- getMinimumSize in class Component
paint
public void paint(Graphics g)
- Paints the contents of the FlowLabel.
- Parameters:
- g - The specified Graphics window.
- Overrides:
- paint in class Canvas
All Packages Class Hierarchy This Package Previous Next Index