borland Packages Class Hierarchy dbswing Package
java.lang.Object +----java.awt.Component +----com.borland.dbswing.TextIcon
Variables Constructors Properties Methods Event Listeners
Implements ImageObserver, MenuContainer, Serializable, Icon
TextIcon
is an opaque icon which simply paints the value of its text
property. It can be used to display a text message wherever an icon is expected. Its size is determined completely by the bounds of its text
property value, which in turn depends upon its font
. If no font is available at the time a request for its size is made, a default dialog plain-style, 12 point font is used.
public TextIcon()Constructs a
TextIcon
component.
public TextIcon(String text)Constructs a
TextIcon
component using the specified String
as its text.
public Font getFont()Returns the font used by the
TextIcon
component.
If no font is available at the time a request for its size is made, a default dialog plain-style, 12 point font is used.
public int getHorizontalAlignment() public void setHorizontalAlignment(int horizontalAlignment)Returns and sets the horizontal alignment of the text. One of:
public int getIconHeight()Returns the height of the
TextIcon
component. The height is based on the text
and font
properties.
public int getIconWidth()Returns the width of the
TextIcon
component. The width is based on the text
and font
properties.
public Insets getMargins() public void setMargins(Insets margins)Returns and sets the margin for the text.
Note that a reference to the parameter rather than a copy is kept, so changing the object after setting this property may have unexpected results.
public Dimension getMaximumSize()Returns the maximum size of the
TextIcon
component. The maximum size is based on the text
and font
properties.
public Dimension getMinimumSize()Returns the minimum size of the
TextIcon
component. The minimum size is based on the text
and font
properties.
public Dimension getPreferredSize()Returns the preferred size of the
TextIcon
component. The preferred size is based on the text
and font
properties.
public Dimension getSize()Returns the actual size of the
TextIcon
component. The actual size is based on the text
and font
properties.
public String getText() public void setText(String text)Returns and sets the text to be drawn.
public int getVerticalAlignment() public void setVerticalAlignment(int verticalAlignment)Returns and sets the vertical alignment of the text. One of:
public void paint(Graphics g)
Overrides: java.awt.Component.paint(java.awt.Graphics)
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addInputMethodListener(java.awt.event.InputMethodListener ) public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public synchronized void addMouseListener(java.awt.event.MouseListener ) public synchronized void removeMouseListener(java.awt.event.MouseListener )
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener ) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )