Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class UIText extends UIStatic { // Constructors public UIText(); public UIText(String text); public UIText(String text, int justify); // Methods public String getName(); public int getRoleCode(); public void setFocus(boolean on); public void setHot(boolean on); public void setName(String text); public void setSelected(boolean on); public Dimension minimumSize(); public void initGraphics(); public void paint(Graphics g, Rectangle rect); }
A class that manages a static text control object, used to display text information.
public UIText();Creates a text control.
public UIText(String text);Creates a text control with a specified string.
Parameter Description text The text to be displayed.
public UIText(String text, int justify);Creates a text control with a specified string and text justification.
Parameter Description text The text to be displayed. justify The justification style. For a description of valid justification values, see Fields.
public String getName();Retrieves the text that isdisplayed by the control.
Return Value:
Returns the string that isdisplayed.
public int getRoleCode();Retrieves the role of the text control.
Return Value:
Returns the ROLE_SYSTEM code that best describes the role of the control.
Remarks:
This method returns the ROLE_SYSTEM_STATICTEXT code.
public void initGraphics();Initializes the graphics when the graphics context is initially made available.
Return Value:
No return value.
Remarks:
This method is used instead of the constructor to do initialization that requires the graphics context. In this case, it computes the size of the control.
public Dimension minimumSize();Retrieves the minimum size of the text control.
Return Value:
Returns minimum dimensions.
public void paint(Graphics g, Rectangle rect);Draws the text control within the specified rectangle.
Return Value:
No return value.
Parameter Description g The graphics context. Rectangle The rectangle to paint the control in.
public void setFocus(boolean on);Sets the focus state of this object.
Parameter Description on Set to true to enable the state, false to disable the state. Remarks:
This method forces a repaint if the control contains text.
public void setHot(boolean on);Sets the hot-track state of this object.
Return Value:
No return value.
Parameter Description on Set to true to enable the state, false to disable the state. Remarks:
This method forces a repaint if the control contains text.
public void setName(String text);Sets the text displayed by the control.
Return Value:
No return value.
Parameter Description text The text to be displayed.
public void setSelected(boolean on);Sets the selected state of this object.
Parameter Description on Set to true to enable the state, false to disable the state. Remarks:
This method forces a repaint if the control contains text.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.