java.awt
public class ScrollPane extends Container implements Accessible
| Nested Class Summary | |
|---|---|
| protected class | ScrollPane.AccessibleAWTScrollPane |
| Field Summary | |
|---|---|
| static int | SCROLLBARS_ALWAYS
Constant indicating that scrollbars are always displayed in this
window. |
| static int | SCROLLBARS_AS_NEEDED
Constant indicating that scrollbars are created as needed in this
windows. |
| static int | SCROLLBARS_NEVER
Constant indicating that scrollbars are never displayed in this window. |
| Constructor Summary | |
|---|---|
| ScrollPane()
Initializes a new instance of ScrollPane with a default
scrollbar policy of SCROLLBARS_AS_NEEDED.
| |
| ScrollPane(int scrollbarDisplayPolicy)
Initializes a new instance of ScrollPane with the
specified scrollbar policy.
| |
| Method Summary | |
|---|---|
| protected void | addImpl(Component component, Object constraints, int index)
Adds the specified child component to this container. |
| void | addNotify()
Notifies this object that it should create its native peer. |
| void | doLayout()
Lays out this component. |
| protected boolean | eventTypeEnabled(int type)
Tells whether or not an event is enabled.
|
| AccessibleContext | getAccessibleContext()
Gets the AccessibleContext associated with this ScrollPane.
|
| Adjustable | getHAdjustable()
Returns the horizontal scrollbar for this object. |
| int | getHScrollbarHeight()
Returns the height of a horizontal scrollbar.
|
| int | getScrollbarDisplayPolicy()
Returns the current scrollbar display policy.
|
| Point | getScrollPosition()
Returns the current scroll position of the viewport.
|
| Adjustable | getVAdjustable()
Returns the vertical scrollbar for this object. |
| Dimension | getViewportSize()
Returns the current viewport size. |
| int | getVScrollbarWidth()
Returns the width of a vertical scrollbar.
|
| boolean | isWheelScrollingEnabled()
Tells whether or not wheel scrolling is enabled.
|
| void | layout()
Lays out this component. |
| String | paramString()
Returns a debug string for this object.
|
| void | printComponents(Graphics graphics)
Prints all of the components in this container.
|
| void | removeNotify()
Notifies this object that it should destroy its native peers. |
| void | setLayout(LayoutManager layoutManager)
This method overrides its superclass method to ensure no layout
manager is set for this container. |
| void | setScrollPosition(Point scrollPosition)
Sets the scroll position to the specified value.
|
| void | setScrollPosition(int x, int y)
Sets the scroll position to the specified value.
|
| void | setWheelScrollingEnabled(boolean enable)
Enables/disables wheel scrolling.
|
ScrollPane with a default
scrollbar policy of SCROLLBARS_AS_NEEDED.
Throws: HeadlessException If GraphicsEnvironment.isHeadless() is true.
ScrollPane with the
specified scrollbar policy.
Parameters: scrollbarDisplayPolicy When to display scrollbars, which must be one of the constants defined in this class.
Throws: HeadlessException If GraphicsEnvironment.isHeadless() is true.
ScrollPane can have at most one child, so if a second
one is added, then first one is removed.
Parameters: component The component to add to this container. constraints A list of layout constraints for this object. index The index at which to add the child, which is ignored in this implementation.
Since: 1.4
ScrollPane.
The context is created, if necessary.
Returns: the associated context
SCROLLBARS_NEVER then this
will be null.
Returns: The horizontal scrollbar for this window.
Returns: The height of a horizontal scrollbar.
Returns: The current scrollbar display policy.
Returns: The current scroll position of the viewport.
Throws: NullPointerException if the scrollpane does have a child.
SCROLLBARS_NEVER then this
will be null.
Returns: The horizontal scrollbar for this window.
Returns: The viewport size.
Returns: The width of a vertical scrollbar.
Since: 1.4
Deprecated: This method is deprecated in favor of
doLayout().
Returns: A debug string for this object.
Parameters: graphics The desired graphics context for printing.
ScrollPane's do
not have layout managers.
Parameters: layoutManager Ignored
Throws: AWTError Always throws this error when called.
Parameters: scrollPosition The new scrollPosition.
Throws: IllegalArgumentException If the specified value is outside the legal scrolling range.
Parameters: x The new X coordinate of the scroll position. y The new Y coordinate of the scroll position.
Throws: NullPointerException if scrollpane does not have a child. IllegalArgumentException If the specified value is outside the legal scrolling range.
Since: 1.4