|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
public class JScrollPane
A component that embeds another component and enables it to be scrolled both in horizontal and vertical direction.
Property | Stored in | Bound? |
---|---|---|
columnHeader | scrollPane | yes |
columnHeaderView | columnHeader | no |
componentOrientation | scrollPane | yes |
horizontalScrollBar | scrollPane | yes |
horizontalScrollBarPolicy | scrollPane | yes |
layout | scrollPane | yes |
rowHeader | scrollPane | yes |
rowHeaderView | rowHeader | no |
validateRoot | scrollPane | no |
verticalScrollBar | scrollPane | yes |
verticalScrollBarPolicy | scrollPane | yes |
viewport | scrollPane | yes |
viewportBorder | scrollPane | yes |
viewportBorderBounds | scrollPane | no |
viewportView | viewport | no |
wheelScrollingEnabled | scrollPane | yes |
Nested Class Summary | |
---|---|
protected class |
JScrollPane.AccessibleJScrollPane
Provides accessibility support for the JScrollPane . |
protected class |
JScrollPane.ScrollBar
|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JViewport |
columnHeader
|
protected JScrollBar |
horizontalScrollBar
|
protected int |
horizontalScrollBarPolicy
|
protected Component |
lowerLeft
|
protected Component |
lowerRight
|
protected JViewport |
rowHeader
|
protected Component |
upperLeft
|
protected Component |
upperRight
|
protected JScrollBar |
verticalScrollBar
|
protected int |
verticalScrollBarPolicy
|
protected JViewport |
viewport
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JScrollPane()
Creates a new JScrollPane without a view. |
|
JScrollPane(Component view)
Creates a new JScrollPane that embeds the specified
view component, displaying vertical and horizontal scrollbars
as needed. |
|
JScrollPane(Component view,
int vsbPolicy,
int hsbPolicy)
Creates a new JScrollPane that embeds the specified
view component; The scrollbar
policies are set to vsbPolicy and hsbPolicy . |
|
JScrollPane(int vsbPolicy,
int hsbPolicy)
Creates a new JScrollPane without a view; The scrollbar
policies are set to vsbPolicy and hsbPolicy . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JViewport columnHeader
protected JViewport rowHeader
protected Component lowerLeft
protected Component lowerRight
protected Component upperLeft
protected Component upperRight
protected JScrollBar horizontalScrollBar
protected int horizontalScrollBarPolicy
protected JScrollBar verticalScrollBar
protected int verticalScrollBarPolicy
protected JViewport viewport
Constructor Detail |
---|
public JScrollPane()
JScrollPane
without a view. The scrollbar
policy is set to ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED
and
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
.
public JScrollPane(Component view)
JScrollPane
that embeds the specified
view
component, displaying vertical and horizontal scrollbars
as needed.
view
- the component that is embedded inside the JScrollPanepublic JScrollPane(int vsbPolicy, int hsbPolicy)
JScrollPane
without a view; The scrollbar
policies are set to vsbPolicy
and hsbPolicy
.
vsbPolicy
- the vertical scrollbar policy to sethsbPolicy
- the vertical scrollbar policy to setScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS
,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER
,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED
,
ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER
public JScrollPane(Component view, int vsbPolicy, int hsbPolicy)
JScrollPane
that embeds the specified
view
component; The scrollbar
policies are set to vsbPolicy
and hsbPolicy
.
vsbPolicy
- the vertical scrollbar policy to sethsbPolicy
- the vertical scrollbar policy to setScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS
,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER
,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED
,
ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER
Method Detail |
---|
public JViewport getColumnHeader()
public Component getCorner(String key)
public JScrollBar getHorizontalScrollBar()
public int getHorizontalScrollBarPolicy()
public JViewport getRowHeader()
public JScrollBar getVerticalScrollBar()
public int getVerticalScrollBarPolicy()
public JViewport getViewport()
public Border getViewportBorder()
public Rectangle getViewportBorderBounds()
public boolean isWheelScrollingEnabled()
public void setComponentOrientation(ComponentOrientation co)
Component
Component.applyComponentOrientation(ComponentOrientation)
affects the
entire hierarchy.
setComponentOrientation
in class Component
co
- the new orientation (null
is accepted)Component.getComponentOrientation()
public void setColumnHeader(JViewport h)
public void setColumnHeaderView(Component c)
public void setCorner(String key, Component c)
public void setHorizontalScrollBar(JScrollBar h)
public void setHorizontalScrollBarPolicy(int h)
public void setLayout(LayoutManager l)
Container
setLayout
in class Container
l
- The new layout manager for this container.public void setRowHeader(JViewport v)
public void setRowHeaderView(Component c)
public void setVerticalScrollBar(JScrollBar v)
public void setVerticalScrollBarPolicy(int v)
public void setWheelScrollingEnabled(boolean b)
public void setViewport(JViewport v)
public void setViewportBorder(Border b)
public void setViewportView(Component view)
public boolean isValidateRoot()
JComponent
true
if this component is a validation root; this
will cause calls to Container.invalidate()
in this component's children
to be "captured" at this component, and not propagate to its parents.
For most components this should return false
, but some
components such as JViewport
will want to return
true
.
isValidateRoot
in class JComponent
public JScrollBar createHorizontalScrollBar()
public JScrollBar createVerticalScrollBar()
protected JViewport createViewport()
public String getUIClassID()
JComponent
UIDefaults
table managed by UIManager
, the
value of which is the name of a class to load for the component's
JComponent.ui
property.
getUIClassID
in class JComponent
"ComponentUI"
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void updateUI()
JComponent
JComponent.getUIClassID()
) from the UIManager
, and calls JComponent.setUI(javax.swing.plaf.ComponentUI)
with the new delegate.
updateUI
in class JComponent
public ScrollPaneUI getUI()
public void setUI(ScrollPaneUI ui)
ui
- The scrollpane's UI delegate.public AccessibleContext getAccessibleContext()
JScrollPane
.
getAccessibleContext
in interface Accessible
getAccessibleContext
in class JComponent
JScrollPane
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |