Package com.ms.ui Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class UITab

Constructors , Methods

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.


Constructors


UITab

public UITab();

Creates a tab control with no content.


UITab

public UITab(String s);

Creates a tab control using the specified text for content.

ParameterDescription
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"));

UITab

public UITab(Component comp);

Creates a tab control using the specified component for content.

ParameterDescription
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));


Methods


getRoleCode

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.


layout

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.


minimumSize

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.


paint

public void paint(Graphics g);

Draws the tab control.

Return Value:

No return value.

ParameterDescription
g The graphics context.

Remarks:

This method draws the tab's top, left, and right edges, with rounded corners.


preferredSize

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.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.