borland Packages  Class Hierarchy  jbcl.control Package  Index 

TextControl component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----com.sun.java.swing.JComponent
                           +----borland.jbcl.control.TextControl

About the TextControl component

Variables  Constructors  Properties  Methods  Event Listeners

Implements BlackBox, ImageObserver, MenuContainer, Serializable

TextControl component is a lightweight component, meaning that it descends from Component and has no window handle and no peer. It displays a specified text string.

Set the text string with the text property. Use the alignment property to align the text within the control, and the margins property to specify the margins around the text. The drawEdge and edgeColor properties affect how the edge is draw around the text. Setting the transparent property to true allows the TextControl to be painted so that you can "see through" the control to the background behind it.

To paint the control, call the paintComponent() method.


TextControl variables

Variables implemented in this class

Variables implemented in com.sun.java.swing.JComponent

Variables implemented in java.awt.Component

TextControl constructors

TextControl properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in com.sun.java.swing.JComponent

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.lang.Object

TextControl methods

Methods implemented in this class

Methods implemented in com.sun.java.swing.JComponent

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.lang.Object

TextControl event listeners


TextControl variables

alignment

  protected int alignment

drawEdge

  protected boolean drawEdge

edgeColor

  protected Color edgeColor

margins

  protected Insets margins

text

  protected String text

transparent

  protected boolean transparent

drawEdge

  protected boolean drawEdge

edgeColor

  protected Color edgeColor

margins

  protected Insets margins

text

  protected String text

transparent

  protected boolean transparent

TextControl constructors

TextControl()

  public TextControl()

Constructs a TextControl with a size of 150 by 20 pixels.

TextControl(java.lang.String)

  public TextControl(java.lang.String text)

Constructs a TextControl with a size of 150 by 20 pixels that displays the text specified with the text parameter.

Parameters:

text
The text that control displays.

TextControl properties

alignment

 public int getAlignment()
 public void setAlignment(int align)

Determines the alignment of the text within the control. The value of alignment must be one of the Alignment variables.

drawEdge

 public boolean isDrawEdge()
 public void setDrawEdge(boolean drawEdge)

Determines whether an edge is drawn around the text. If true, an edge is drawn around the text; if false, no edge is drawn.

edgeColor

 public Color getEdgeColor()
 public void setEdgeColor(java.awt.Color edgeColor)

Determines the color of the edge drawn around the text. Specify one of the java.awt.Color variables.

margins

 public Insets getMargins()
 public void setMargins(java.awt.Insets margins)

Determines the size of the margins around the text in the control.

preferredSize

 public Dimension getPreferredSize()

Returns the preferred size of the control.

text

 public String getText()
 public void setText(java.lang.String text)

Determines the text that appears in the control.

transparent

 public boolean isTransparent()
 public void setTransparent(boolean transparent)

Determines whether the control is "transparent", so that you can "see through" the control. If true, the control is transparent; if false, the control is not transparent.


TextControl methods

paintComponent(java.awt.Graphics)

  public void paintComponent(java.awt.Graphics g)
Paints or repaints the control.

Overrides: com.sun.java.swing.JComponent.paintComponent(java.awt.Graphics)

update(java.awt.Graphics)

  public void update(java.awt.Graphics g)

Overrides: java.awt.Component.update(java.awt.Graphics)


TextControl event listeners

This component is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events.

ancestor

 public void addAncestorListener(com.sun.java.swing.event.AncestorListener )
 public void removeAncestorListener(com.sun.java.swing.event.AncestorListener )

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener )
 public void removeContainerListener(java.awt.event.ContainerListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )

propertyChange

 public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener )
 public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )

vetoableChange

 public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener )
 public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )