java.awt
Class ScrollPane
- Accessible, ImageObserver, MenuContainer, Serializable
This widget provides a scrollable region that allows a single
subcomponent to be viewed through a smaller window.
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.
|
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.
|
add , add , add , add , add , addContainerListener , addImpl , addNotify , addPropertyChangeListener , addPropertyChangeListener , applyComponentOrientation , areFocusTraversalKeysSet , countComponents , deliverEvent , doLayout , extends EventListener> T[] getListeners , findComponentAt , findComponentAt , getAlignmentX , getAlignmentY , getComponent , getComponentAt , getComponentAt , getComponentCount , getComponentZOrder , getComponents , getContainerListeners , getFocusTraversalKeys , getFocusTraversalPolicy , getInsets , getLayout , getMaximumSize , getMinimumSize , getPreferredSize , insets , invalidate , isAncestorOf , isFocusCycleRoot , isFocusCycleRoot , isFocusTraversalPolicyProvider , isFocusTraversalPolicySet , layout , list , list , locate , minimumSize , paint , paintComponents , paramString , preferredSize , print , printComponents , processContainerEvent , processEvent , remove , remove , removeAll , removeContainerListener , removeNotify , setComponentZOrder , setFocusCycleRoot , setFocusTraversalKeys , setFocusTraversalPolicy , setFocusTraversalPolicyProvider , setFont , setLayout , transferFocusDownCycle , update , validate , validateTree |
action , add , addComponentListener , addFocusListener , addHierarchyBoundsListener , addHierarchyListener , addInputMethodListener , addKeyListener , addMouseListener , addMouseMotionListener , addMouseWheelListener , addNotify , addPropertyChangeListener , addPropertyChangeListener , applyComponentOrientation , areFocusTraversalKeysSet , bounds , checkImage , checkImage , coalesceEvents , contains , contains , createImage , createImage , createVolatileImage , createVolatileImage , deliverEvent , disable , disableEvents , dispatchEvent , doLayout , enable , enable , enableEvents , enableInputMethods , extends EventListener> T[] getListeners , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , getAccessibleContext , getAlignmentX , getAlignmentY , getBackground , getBounds , getBounds , getColorModel , getComponentAt , getComponentAt , getComponentListeners , getComponentOrientation , getCursor , getDropTarget , getFocusCycleRootAncestor , getFocusListeners , getFocusTraversalKeys , getFocusTraversalKeysEnabled , getFont , getFontMetrics , getForeground , getGraphics , getGraphicsConfiguration , getHeight , getHierarchyBoundsListeners , getHierarchyListeners , getIgnoreRepaint , getInputContext , getInputMethodListeners , getInputMethodRequests , getKeyListeners , getLocale , getLocation , getLocation , getLocationOnScreen , getMaximumSize , getMinimumSize , getMouseListeners , getMouseMotionListeners , getMouseWheelListeners , getName , getParent , getPeer , getPreferredSize , getPropertyChangeListeners , getPropertyChangeListeners , getSize , getSize , getToolkit , getTreeLock , getWidth , getX , getY , gotFocus , handleEvent , hasFocus , hide , imageUpdate , inside , invalidate , isBackgroundSet , isCursorSet , isDisplayable , isDoubleBuffered , isEnabled , isFocusCycleRoot , isFocusOwner , isFocusTraversable , isFocusable , isFontSet , isForegroundSet , isLightweight , isMaximumSizeSet , isMinimumSizeSet , isOpaque , isPreferredSizeSet , isShowing , isValid , isVisible , keyDown , keyUp , layout , list , list , list , list , list , locate , location , lostFocus , minimumSize , mouseDown , mouseDrag , mouseEnter , mouseExit , mouseMove , mouseUp , move , nextFocus , paint , paintAll , paramString , postEvent , preferredSize , prepareImage , prepareImage , print , printAll , processComponentEvent , processEvent , processFocusEvent , processHierarchyBoundsEvent , processHierarchyEvent , processInputMethodEvent , processKeyEvent , processMouseEvent , processMouseMotionEvent , processMouseWheelEvent , remove , removeComponentListener , removeFocusListener , removeHierarchyBoundsListener , removeHierarchyListener , removeInputMethodListener , removeKeyListener , removeMouseListener , removeMouseMotionListener , removeMouseWheelListener , removeNotify , removePropertyChangeListener , removePropertyChangeListener , repaint , repaint , repaint , repaint , requestFocus , requestFocus , requestFocusInWindow , requestFocusInWindow , reshape , resize , resize , setBackground , setBounds , setBounds , setComponentOrientation , setCursor , setDropTarget , setEnabled , setFocusTraversalKeys , setFocusTraversalKeysEnabled , setFocusable , setFont , setForeground , setIgnoreRepaint , setLocale , setLocation , setLocation , setMaximumSize , setMinimumSize , setName , setPreferredSize , setSize , setSize , setVisible , show , show , size , toString , transferFocus , transferFocusBackward , transferFocusUpCycle , update , validate |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
SCROLLBARS_ALWAYS
public static final int SCROLLBARS_ALWAYS
Constant indicating that scrollbars are always displayed in this
window.
SCROLLBARS_AS_NEEDED
public static final int SCROLLBARS_AS_NEEDED
Constant indicating that scrollbars are created as needed in this
windows.
SCROLLBARS_NEVER
public static final int SCROLLBARS_NEVER
Constant indicating that scrollbars are never displayed in this window.
ScrollPane
public ScrollPane()
Initializes a new instance of ScrollPane
with a default
scrollbar policy of SCROLLBARS_AS_NEEDED
.
ScrollPane
public ScrollPane(int scrollbarDisplayPolicy)
Initializes a new instance of ScrollPane
with the
specified scrollbar policy.
scrollbarDisplayPolicy
- When to display scrollbars, which must
be one of the constants defined in this class.
addImpl
protected final void addImpl(Component component,
Object constraints,
int index)
Adds the specified child component to this container. A
ScrollPane
can have at most one child, so if a second
one is added, then first one is removed.
- addImpl in interface Container
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.
doLayout
public void doLayout()
Lays out this component. This consists of resizing the sole child
component to its perferred size.
- doLayout in interface Container
eventTypeEnabled
protected boolean eventTypeEnabled(int type)
Tells whether or not an event is enabled.
getHAdjustable
public Adjustable getHAdjustable()
Returns the horizontal scrollbar for this object. If the scrollbar
display policy is set to SCROLLBARS_NEVER
then this
will be null
.
- The horizontal scrollbar for this window.
getHScrollbarHeight
public int getHScrollbarHeight()
Returns the height of a horizontal scrollbar.
- The height of a horizontal scrollbar.
getScrollPosition
public Point getScrollPosition()
Returns the current scroll position of the viewport.
- The current scroll position of the viewport.
getScrollbarDisplayPolicy
public int getScrollbarDisplayPolicy()
Returns the current scrollbar display policy.
- The current scrollbar display policy.
getVAdjustable
public Adjustable getVAdjustable()
Returns the vertical scrollbar for this object. If the scrollbar
display policy is set to SCROLLBARS_NEVER
then this
will be null
.
- The horizontal scrollbar for this window.
getVScrollbarWidth
public int getVScrollbarWidth()
Returns the width of a vertical scrollbar.
- The width of a vertical scrollbar.
getViewportSize
public Dimension getViewportSize()
Returns the current viewport size. The viewport is the region of
this object's window where the child is actually displayed.
layout
public void layout()
This method is deprecated in favor of
doLayout()
.
Lays out this component. This consists of resizing the sole child
component to its perferred size.
- layout in interface Container
setLayout
public final void setLayout(LayoutManager layoutManager)
This method overrides its superclass method to ensure no layout
manager is set for this container. ScrollPane
's do
not have layout managers.
- setLayout in interface Container
setScrollPosition
public void setScrollPosition(int x,
int y)
Sets the scroll position to the specified value.
x
- The new X coordinate of the scroll position.y
- The new Y coordinate of the scroll position.
ScrollPane.java -- Scrolling window
Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.