Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class UITabList extends UISelector { // Constructors public UITabList(); // Methods public Component add(String s); public Component add(String s, int pos); public Component add(Component comp); public Component add(Component comp, int pos); public Insets insets(); public void paint(Graphics g); public boolean handleEvent(Event e); }
A class that implements a tab list control; each tab in the list is a UITab object. 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.
UITabList extends UISelector.
public UITabList();Creates an empty tab list control.
Remarks:
Call the add method to add tabs to the list. By default, the control allows only one tab to be selected at a time.
public Component add(String s);Adds a new tab containing the specified text to the end of the tab list control.
Return Value:
Returns the UITab object that was added.
Parameter Description s The text to be displayed on the tab being added. 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.
UITabList t = new UITabList(); t.add(new UIText("Text not hot-tracked"));
public Component add(String s, int pos);Adds a new tab containing the specified text to the tab list control. The tab is added at the specified position.
Return Value:
Returns the UITab object that was added.
Parameter Description s The text to be displayed on the tab being added. pos The indexed position at which to add the tab. 0 identifies the first position; -1 identifies the end of the tab list. 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.
UITabList t = new UITabList() t.add(new UIText("Text not hot-tracked"), 0);
public Component add(Component comp);Adds a tab to the end of the tab list control.
Return Value:
Returns the UITab object that was added.
Parameter Description comp The component to be displayed on the tab being added. If comp is already a tab object, then this tab is added. Otherwise, a new tab is created. Remarks:
Typically, you'll pass a UIText, UIGraphic, or UIText 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.
UITabList t = new UITabList(); t.add(new UIText("Hot-tracked text", UIStatic.HOTTRACK));
public Component add(Component comp, int pos);Adds a tab to the tab list control at the specified position.
Return Value:
Returns the UITab object that was added.
Parameter Description comp The component to be displayed on the tab being added. If comp is already a tab object, then this tab is added. Otherwise, a new tab is created. pos The indexed position at which to add the tab. 0 identifies the first position; -1 identifies the end of the tab list. Remarks:
Typically, you'll pass a UIText, UIGraphic, or UIText 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.
UITabList t = new UITabList(); t.add(new UIText("Hot-tracked text", UIStatic.HOTTRACK), 0);
public boolean handleEvent(Event e);Determines if a tab in the list has been selected, and, if so, lays out the tab list control.
Return Value:
Returns true if the event was handled; otherwise, returns false.
Parameter Description e The event.
public Insets insets();Determines the tab list control's insets (in pixels), which indicate the size of the control's border.
Return Value:
Returns an Insets object containing the tab list control's insets.
Remarks:
This method defines the top and bottom insets to be 2 pixels, and the left and right insets to be 0 pixels.
public void paint(Graphics g);Draws the tab list control.
Return Value:
No return value.
Parameter Description g The graphics context.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.