Class tea.set.ImageLabel
All Packages Class Hierarchy This Package Previous Next Index
Class tea.set.ImageLabel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----tea.set.ImageLabel
- public class ImageLabel
- extends Canvas
ImageLabel is an enhanced version of the AWT.Label class. In addition
to a text label, an image can be displayed together at the lefthand
side of the label. The image is always scaled to the width and height
equal to the height of the widget. The label itself does
not provide any border. Use Effect3D to add a border if one is
desired.
Example:
text = new ImageLabel(getImage(url), label);
add("North", new Effect3D(text, Effect3D.LOWERED));
- See Also:
- Label
-
ImageLabel(Image, String)
- Construct an ImageLabel with specified image and text.
-
minimumSize()
- Return the minimum size of the label.
-
paint(Graphics)
- Paint the image and text.
-
preferredSize()
- Return the preferred size of the label.
ImageLabel
public ImageLabel(Image image,
String label)
- Construct an ImageLabel with specified image and text.
- Parameters:
- image - label image.
- label - label text.
minimumSize
public Dimension minimumSize()
- Return the minimum size of the label. The Image is scaled to
be the same height and width as the height of the text string.
- Returns:
- minimum size.
- Overrides:
- minimumSize in class Component
preferredSize
public Dimension preferredSize()
- Return the preferred size of the label. In this case it's the
same as minimumSize().
- Returns:
- preferred size.
- Overrides:
- preferredSize in class Component
paint
public void paint(Graphics g)
- Paint the image and text.
- Parameters:
- g - Graphics context of this component.
- Overrides:
- paint in class Canvas
All Packages Class Hierarchy This Package Previous Next Index