java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JScrollPane
Safe:
_bounds, accessibleContext, listenerList, paintingChild, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
JScrollPane()
JScrollPane
where both horizontal and vertical scrollbars appear when needed.
JScrollPane(Component view)
JScrollPane that displays the
contents of the specified
component, where both horizontal and vertical scrollbars appear
whenever the component's contents are larger than the view.
JScrollPane(Component view,
int vsbPolicy,
int hsbPolicy)
JScrollPane that displays the view
component in a viewport
whose view position can be controlled with a pair of scrollbars.
JScrollPane(int vsbPolicy,
int hsbPolicy)
JScrollPane
with specified
scrollbar policies.
AccessibleContext
getAccessibleContext()
JScrollBar
getHorizontalScrollBar()
javax.swing.plaf.ScrollPaneUI
getUI()
String
getUIClassID()
JScrollBar
getVerticalScrollBar()
javax.swing.border.Border
getViewportBorder()
Border object that surrounds the viewport.
boolean
isWheelScrollingEnabled()
void
setColumnHeaderView(Component view)
void
setComponentOrientation(ComponentOrientation co)
ComponentOrientation argument.
void
setCorner(String key,
Component corner)
void
setHorizontalScrollBar(JScrollBar horizontalScrollBar)
void
setHorizontalScrollBarPolicy(int policy)
void
setRowHeaderView(Component view)
void
setUI(javax.swing.plaf.ScrollPaneUI ui)
ScrollPaneUI object that provides the
look and feel (L&F) for this component.
void
setVerticalScrollBar(JScrollBar verticalScrollBar)
void
setVerticalScrollBarPolicy(int policy)
void
setViewport(JViewport viewport)
void
setViewportBorder(javax.swing.border.Border viewportBorder)
void
setViewportView(Component view)
void
setWheelScrollingEnabled(boolean handleWheel)
void
updateUI()
ScrollPaneUI object with a version
from the current default look and feel.
private void
writeObject(ObjectOutputStream s)
readObject and writeObject in
JComponent for more
information about serialization in Swing.
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, checkIfChildObscuredBySibling, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getManagingFocusBackwardTraversalKeys, getManagingFocusForwardTraversalKeys, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getWriteObjCounter, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, setWriteObjCounter, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, get, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, iterate, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, size, transferFocusBackward, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, toString, transferFocus, transferFocus, transferFocusUpCycle
private javax.swing.border.Border viewportBorder
private static final String uiClassID
protected int verticalScrollBarPolicy
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED.
setVerticalScrollBarPolicy(int)protected int horizontalScrollBarPolicy
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED.
setHorizontalScrollBarPolicy(int)protected JViewport viewport
JViewport.
setViewport(javax.swing.JViewport)protected JScrollBar verticalScrollBar
JScrollBar.
protected JScrollBar horizontalScrollBar
JScrollBar.
protected JViewport rowHeader
null.
setRowHeader(javax.swing.JViewport)protected JViewport columnHeader
null.
protected Component lowerLeft
null.
protected Component lowerRight
null.
protected Component upperLeft
null.
protected Component upperRight
null.
private boolean wheelScrollState
public JScrollPane(Component view, int vsbPolicy, int hsbPolicy)
JScrollPane that displays the view
component in a viewport
whose view position can be controlled with a pair of scrollbars.
The scrollbar policies specify when the scrollbars are displayed,
For example, if vsbPolicy is
VERTICAL_SCROLLBAR_AS_NEEDED
then the vertical scrollbar only appears if the view doesn't fit
vertically. The available policy settings are listed at
setVerticalScrollBarPolicy(int) and
setHorizontalScrollBarPolicy(int).
view - the component to display in the scrollpanes viewportvsbPolicy - an integer that specifies the vertical
scrollbar policyhsbPolicy - an integer that specifies the horizontal
scrollbar policysetViewportView(java.awt.Component)public JScrollPane(Component view)
JScrollPane that displays the
contents of the specified
component, where both horizontal and vertical scrollbars appear
whenever the component's contents are larger than the view.
view - the component to display in the scrollpane's viewportsetViewportView(java.awt.Component)public JScrollPane(int vsbPolicy, int hsbPolicy)
JScrollPane
with specified
scrollbar policies. The available policy settings are listed at
setVerticalScrollBarPolicy(int) and
setHorizontalScrollBarPolicy(int).
vsbPolicy - an integer that specifies the vertical
scrollbar policyhsbPolicy - an integer that specifies the horizontal
scrollbar policysetViewportView(java.awt.Component)public JScrollPane()
JScrollPane
where both horizontal and vertical scrollbars appear when needed.
public javax.swing.plaf.ScrollPaneUI getUI()
ScrollPaneUI object that renders this
componentsetUI(javax.swing.plaf.ScrollPaneUI)public void setUI(javax.swing.plaf.ScrollPaneUI ui)
ScrollPaneUI object that provides the
look and feel (L&F) for this component.
ui - the ScrollPaneUI L&F objectgetUI()public void updateUI()
ScrollPaneUI object with a version
from the current default look and feel.
To be called when the default look and feel changes.
updateUI in class JComponentpublic String getUIClassID()
getUIClassID in class JComponentJComponent.getUIClassID(),
UIDefaults.getUI(javax.swing.JComponent)public void setLayout(LayoutManager layout)
JScrollPane.
This method overrides setLayout in
java.awt.Container to ensure that only
LayoutManagers which
are subclasses of ScrollPaneLayout can be used in a
JScrollPane. If layout is non-null, this
will invoke syncWithScrollPane on it.
layout - the specified layout managerjava.awt.Container#getLayout,
java.awt.Container#setLayoutpublic boolean isValidateRoot()
revalidate on any descendant of this
JScrollPane. For example,
the viewport's view, will cause a request to be queued that
will validate the JScrollPane and all its descendants.
isValidateRoot in class JComponentJComponent.revalidate()public int getVerticalScrollBarPolicy()
verticalScrollBarPolicy propertysetVerticalScrollBarPolicy(int)public void setVerticalScrollBarPolicy(int policy)
policy - one of the three values listed abovegetVerticalScrollBarPolicy()public int getHorizontalScrollBarPolicy()
horizontalScrollBarPolicy propertysetHorizontalScrollBarPolicy(int)public void setHorizontalScrollBarPolicy(int policy)
policy - one of the three values listed abovegetHorizontalScrollBarPolicy()public javax.swing.border.Border getViewportBorder()
Border object that surrounds the viewport.
viewportBorder propertysetViewportBorder(javax.swing.border.Border)public void setViewportBorder(javax.swing.border.Border viewportBorder)
JViewport doesn't support
the JComponent border property.
Similarly setting the JScrollPanes
viewport doesn't affect the viewportBorder property.
The default value of this property is computed by the look and feel implementation.
viewportBorder - the border to be addedgetViewportBorder(),
setViewport(javax.swing.JViewport)public Rectangle getViewportBorderBounds()
Rectangle object specifying the viewport borderpublic JScrollBar createHorizontalScrollBar()
JScrollPane.ScrollBar by default.
Subclasses may override this method to force ScrollPaneUI
implementations to use a JScrollBar subclass.
Used by ScrollPaneUI implementations to
create the horizontal scrollbar.
JScrollBar with a horizontal orientationJScrollBarpublic JScrollBar getHorizontalScrollBar()
horizontalScrollBar propertysetHorizontalScrollBar(javax.swing.JScrollBar)public void setHorizontalScrollBar(JScrollBar horizontalScrollBar)
JScrollPane creates
horizontal and vertical scrollbars by default.
horizontalScrollBar - the horizontal scrollbar to be addedcreateHorizontalScrollBar(),
getHorizontalScrollBar()public JScrollBar createVerticalScrollBar()
JScrollPane.ScrollBar by default. Subclasses
may override this method to force ScrollPaneUI
implementations to use a JScrollBar subclass.
Used by ScrollPaneUI implementations to create the
vertical scrollbar.
JScrollBar with a vertical orientationJScrollBarpublic JScrollBar getVerticalScrollBar()
verticalScrollBar propertysetVerticalScrollBar(javax.swing.JScrollBar)public void setVerticalScrollBar(JScrollBar verticalScrollBar)
JScrollPane creates vertical and
horizontal scrollbars by default.
verticalScrollBar - the new vertical scrollbar to be addedcreateVerticalScrollBar(),
getVerticalScrollBar()protected JViewport createViewport()
JViewport by default.
Used to create the
viewport (as needed) in setViewportView,
setRowHeaderView, and setColumnHeaderView.
Subclasses may override this method to return a subclass of
JViewport.
JViewportpublic JViewport getViewport()
JViewport.
viewport propertysetViewport(javax.swing.JViewport)public void setViewport(JViewport viewport)
Most applications will find it more convenient to use
setViewportView
to add a viewport and a view to the scrollpane.
viewport - the new viewport to be used; if viewport is
null, the old viewport is still removed
and the new viewport is set to nullcreateViewport(),
getViewport(),
setViewportView(java.awt.Component)public void setViewportView(Component view)
JScrollPane
constructor
should use this method to specify the scrollable child that's going
to be displayed in the scrollpane. For example:
JScrollPane scrollpane = new JScrollPane(); scrollpane.setViewportView(myBigComponentToScroll);Applications should not add children directly to the scrollpane.
view - the component to add to the viewportsetViewport(javax.swing.JViewport),
JViewport.setView(java.awt.Component)public JViewport getRowHeader()
rowHeader propertysetRowHeader(javax.swing.JViewport)public void setRowHeader(JViewport rowHeader)
null, syncs the y coordinate of its
viewPosition with
the viewport (if there is one) and then adds it to the scrollpane.
Most applications will find it more convenient to use
setRowHeaderView
to add a row header component and its viewport to the scrollpane.
rowHeader - the new row header to be used; if null
the old row header is still removed and the new rowHeader
is set to nullgetRowHeader(),
setRowHeaderView(java.awt.Component)public void setRowHeaderView(Component view)
JScrollPane scrollpane = new JScrollPane(); scrollpane.setViewportView(myBigComponentToScroll); scrollpane.setRowHeaderView(myBigComponentsRowHeader);
view - the component to display as the row headersetRowHeader(javax.swing.JViewport),
JViewport.setView(java.awt.Component)public JViewport getColumnHeader()
columnHeader propertysetColumnHeader(javax.swing.JViewport)public void setColumnHeader(JViewport columnHeader)
null, sync the x coordinate of the its viewPosition
with the viewport (if there is one) and then add it to the scrollpane.
Most applications will find it more convenient to use
setRowHeaderView
to add a row header component and its viewport to the scrollpane.
public void setColumnHeaderView(Component view)
JScrollPane scrollpane = new JScrollPane(); scrollpane.setViewportView(myBigComponentToScroll); scrollpane.setColumnHeaderView(myBigComponentsColumnHeader);
view - the component to display as the column headersetColumnHeader(javax.swing.JViewport),
JViewport.setView(java.awt.Component)public Component getCorner(String key)
key value specifying the corner is one of:
key - one of the values as shown above
null
if key is invalid:
setCorner(java.lang.String, java.awt.Component)public void setCorner(String key, Component corner)
Although "corner" doesn't match any beans property
signature, PropertyChange events are generated with the
property name set to the corner key.
key - identifies which corner the component will appear incorner - one of the following components:
public void setComponentOrientation(ComponentOrientation co)
ComponentOrientation argument.
setComponentOrientation in class Componentco - one of the following values:
java.awt.ComponentOrientationpublic boolean isWheelScrollingEnabled()
setWheelScrollingEnabled(boolean)public void setWheelScrollingEnabled(boolean handleWheel)
handleWheel - true if scrolling should be done
automatically for a MouseWheelEvent,
false otherwise.isWheelScrollingEnabled(),
java.awt.event.MouseWheelEvent,
java.awt.event.MouseWheelListenerprivate void writeObject(ObjectOutputStream s) throws IOException
readObject and writeObject in
JComponent for more
information about serialization in Swing.
s - the ObjectOutputStream in which to write
IOExceptionprotected String paramString()
JScrollPane.
This method
is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not
be null.
paramString in class JComponentJScrollPane.public AccessibleContext getAccessibleContext()
getAccessibleContext in interface AccessiblegetAccessibleContext in class JComponent