Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class UITab extends UIPanel implements IFxGraphicsConstants { // Constructors public UITab(); public UITab(String s); public UITab(Component comp); // Methods public Dimension minimumSize(); public Dimension preferredSize(); public int getRoleCode(); public void layout(); public void paint(Graphics g); }
A class that implements a tab control; used by UITabList. You'll typically use UITabViewer, rather than direclty using UITabList or UITab. UITabViewer uses UITabList internally to create a list of tabs and their associated pages.
public UITab();Creates a tab control with no content.
public UITab(String s);Creates a tab control using the specified text for content.
Parameter Description s The text to be displayed on the tab. Remarks:
By default, the text is left-aligned and hot-tracked. To display text that is not hot-tracked, pass a UIText object instead of a String, as shown in the following example.
UITab t = new UITab(new UIText("Text not hot-tracked"));
public UITab(Component comp);Creates a tab control using the specified component for content.
Parameter Description comp The component to be displayed on the tab. Remarks:
Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. Note that by default, the component is not hot-tracked. To add this support, include the UIStatic.HOTTRACK flag, as shown in the following example.
UITab t = new UITab(new UIText("Hot-tracked text", UIStatic.HOTTRACK));
public int getRoleCode();Retrieves the role of the tab control.
Return Value:
Returns the ROLE_SYSTEM code that best describes the role of the tab.
Remarks:
This method returns the ROLE_SYSTEM_PAGETAB code.
public void layout();Lays out the tab control.
Return Value:
No return value.
Remarks:
This method checks the tab's selected state to determine its appropriate size, and then reshapes the control.
public Dimension minimumSize();Retrieves the minimum size (in pixels) of the tab control.
Return Value:
Returns a Dimension object containing the minimum size.
Remarks:
By default, this method returns the preferred size, as determined by preferredSize.
public void paint(Graphics g);Draws the tab control.
Return Value:
No return value.
Parameter Description g The graphics context. Remarks:
This method draws the tab's top, left, and right edges, with rounded corners.
public Dimension preferredSize();Retrieves the preferred size (in pixels) of the tab control.
Return Value:
Returns a Dimension object containing the preferred size.
Remarks:
This method determines the preferred size of the component displayed on the tab, and adds the extra width and height needed for the tab's edges.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.