Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


Class AwtUIText

public class AwtUIText extends AwtUIControl
{
  // Constructors
  public AwtUIText();
  public AwtUIText(String text);
  public AwtUIText(String text, int justify);

  // Methods
  public IUIComponent getBase();
  public String getText();
  public void setText(String text);
}

This class implements the functionality of a UIText object in an AWT-based control. An AwtUIText control is an AwtUIHost component whose associated root container holds a UIText object. By hosting this object, an AwtUIText control integrates AFC with AWT. Although an AwtUIText control is fully compatible with AWT, a UIText control is optimized for performance and size.

Panel
  |
  +--AwtUIHost
    |
    +--AwtUIControl
      |
      +--AwtUIText

Constructors

AwtUIText

public AwtUIText();

Creates an AWT-based text control with no text.

AwtUIText

public AwtUIText(String text);

Creates an AWT-based text control with the specified text.

ParameterDescription
text The text to be displayed within the control.

Remarks:

By default, the text is aligned both horizontally and vertically.

AwtUIText

public AwtUIText(String text, int justify);

Creates an AWT-based text control with the specified text and style.

ParameterDescription
text The text to be displayed within the control.
justify The alignment and style of the control. You can pass any bitwise combination of an alignment flag and a style flag. For a list of possible flags, see the UIStatic.setFlags method.

Remarks:

If a vertical alignment is not specified, VCENTER is used by default. Similarly, if a horizontal alignment is not specified, HCENTER is used.

Exceptions:

IllegalArgumentException if more than one vertical alignment, more than one horizontal alignment, or an undefined style was specified.

Methods

getBase

public IUIComponent getBase();

Retrieves the UI component that the control is based on.

Return Value:

Returns the UIText object associated with the control.

Remarks:

When the AWT-based control is first created, it is associated with a UIText object.

getText

public String getText();

Retrieves the control's text.

Return Value:

Returns the text string currently displayed within the control.

See Also: setText

setText

public void setText(String text);

Sets the control's text.

Return Value:

No return value.

ParameterDescription
text The text to be displayed within the control.

See Also: getText

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.