Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class UIScrollBar extends UIScroll { // Fields public static final int LINE_UP; public static final int LINE_DOWN; // Constructors public UIScrollBar(); public UIScrollBar(int style); public UIScrollBar(int style, int min, int max, int page, int line, int pos); // Methods public Component add(int index, Component comp); public Component getLayoutComponent(int index); public void initGraphics(); public void setStyle(int style); public Insets insets(); public void layout(); public Dimension minimumSize(); public Dimension preferredSize(); }
A class that implements a scroll bar control. UIScrollBar extends UIScroll by adding the LINE_UP and LINE_DOWN components to the ends of the scroll track. By default, these components are UIRepeatButton objects.
public UIScrollBar();Creates a horizontal scroll bar control. By default, the scroll bar has a range of 0 to 100.
public UIScrollBar(int style);Creates a scroll bar control with the specified style. By default, the scroll bar has a range of 0 to 100.
Parameter Description style The style of the scroll bar. Specify one of the following values:
- UIScroll.NOHIDE
- UIScroll.NOSHOW
- UIScroll.VERTICAL
- 0 (for a horizontal scroll bar)
If an undefined style is specified, an IllegalArgumentException is thrown.
public UIScrollBar(int style, int min, int max, int page, int line, int pos);Creates a scroll bar control with the specified style and scroll information.
Parameter Description style The style of the scroll bar. Specify one of the following values:
- UIScroll.NOHIDE
- UIScroll.NOSHOW
- UIScroll.VERTICAL
- 0 (for a horizontal scroll bar)
If an undefined style is specified, an IllegalArgumentException is thrown.
min The minimum value in the scroll bar's range. max The maximum value in the scroll bar's range. page The number of scroll positions associated with a full page. line The number of pixels associated with a scroll position. pos The current position of the scroll bar control within its range.
public Component add(int index, Component comp);Adds the specified component at the given layout index. If a component already exists at this index, it is replaced with the specified component.
Return Value:
Returns the component that was added.
Parameter Description index The layout index of the component to be added or replaced. Specify one of the following values: If an undefined index is specified, an IllegalArgumentException is thrown.
comp The component to be added.
public Component getLayoutComponent(int index);Retrieves the component at the specified layout index.
Return Value:
Returns the specified component, or null if no such component exists.
Parameter Description index The layout index of the component to be retrieved. Specify one of the following values: If an undefined layout index is specified, an IllegalArgumentException is thrown.
public void initGraphics();Called to perform initialization when the graphics context is first available.
Return Value:
No return value.
Remarks:
This method adds the THUMB, PAGE_UP, PAGE_DOWN, LINE_UP, and LINE_DOWN components to the scroll bar. If the scroll bar is horizontal, the LINE_UP and LINE_DOWN components display the system-defined left and right arrows, respectively. If the scroll bar is vertical, the components displays the system-defined up and down arrows.
public Insets insets();Determines the scroll bar's insets (in pixels), which indicate the size of the control's border.
Return Value:
Returns an Insets object containing the scroll bar's insets.
public void layout();Lays out the components of the scroll bar control.
Return Value:
No return value.
Remarks:
If the scroll bar has the NOHIDE style, it will be disabled if scrolling is not necessary. Otherwise, if the NOSHOW style is set, or if scrolling is not necessary, the control will be hidden.
public Dimension minimumSize();Determines the minimum size (in pixels) of the scroll bar control.
Return Value:
Returns a Dimension object containing the minimum size.
Remarks:
The control's minimum size is based on the minimum of each of its components.
public Dimension preferredSize();Determines the preferred size (in pixels) of the scroll bar control.
Return Value:
Returns a Dimension object containing the preferred size.
Remarks:
The control's preferred size is based on the preferred size of each of its components.
public void setStyle(int style);Sets the current style for the scroll bar control.
Return Value:
No return value.
Parameter Description style The style of the scroll bar. Specify one of the following values:
- UIScroll.NOHIDE
- UIScroll.NOSHOW
- UIScroll.VERTICAL
- 0 (for a horizontal scroll bar)
If an undefined style is specified, an IllegalArgumentException is thrown.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.