Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JScrollPane
|
In addition to the scroll bars and viewport, a JScrollPane can have a
column header and a row header. Each of these is a JViewport object that
you specify with setRowHeaderView
, and setColumnHeaderView
.
The column header viewport automatically scrolls left and right, tracking
the left-right scrolling of the main viewport. (It never scrolls vertically,
however.) The row header acts in a similar fashion.
By default, the corners are empty. You can put a component into a corner using
setCorner
, in case you there is some function or decoration you
would like to add to the scroll pane. The size of corner components is
entirely determined by the size of the headers and scroll bars that surround them.
To add a border around the main viewport, you can use setViewportBorder
.
(Of course, you can also add a border around the whole scroll pane using
setBorder
.)
For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JScrollPane key assignments.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
JScrollPane.AccessibleJScrollPane
The class used to obtain the accessible role for this object. |
|
JScrollPane.ScrollBar
By default JScrollPane creates scrollbars that are instances of this class. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Field Summary | |
static java.lang.String[] | cornerKeywords
An array of constants that specify the corners |
Fields inherited from class com.sun.java.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 |
Constructor Summary | |
JScrollPane(java.awt.Component view,
int vsbPolicy,
int hsbPolicy)
Create a JScrollPane that displays the contents of the specified component using the specified scrollbar policies. |
|
JScrollPane(java.awt.Component view)
Create a 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(int vsbPolicy,
int hsbPolicy)
Create an empty JScrollPane with specified scrollbar policies. |
|
JScrollPane()
Create an empty JScrollPane where both horizontal and vertical scrollbars appear when needed. |
Method Summary | |
JScrollBar | createHorizontalScrollBar()
Used by ScrollPaneUI implementations to create the horizontal scrollbar. |
JScrollBar | createVerticalScrollBar()
Used by ScrollPaneUI implementations to create the vertical scrollbar. |
JViewport | createViewport()
Returns a new JViewport by default. |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JComponent |
JViewport | getColumnHeader()
Returns the column-header viewport. |
java.awt.Component | getCorner(java.lang.String key)
Returns the _________________, where the options for the key are:
|
JScrollBar | getHorizontalScrollBar()
Returns the horizontal scroll bar currently in use. |
int | getHorizontalScrollBarPolicy()
Returns the horizontal scrollbar policy. |
JViewport | getRowHeader()
Returns the row-header viewport. |
java.lang.String | getUIClassID()
Returns the name of the L&F class that renders this component. |
com.sun.java.swing.plaf.ScrollPaneUI | getUI()
Returns the L&F object that renders this component. |
JScrollBar | getVerticalScrollBar()
Returns the vertical scroll bar currently in use. |
int | getVerticalScrollBarPolicy()
Returns the vertical scrollbar policy. |
Border | getViewportBorder()
Returns the value of the viewportBorder property. |
JViewport | getViewport()
Returns the current JViewport. |
boolean | isOpaque()
Returns true if this component paints every pixel in its range. |
boolean | isValidateRoot()
Calls to revalidate() any descendant of this JScrollPane, e.g. the viewports view, will cause a request to be queued that will validate this JScrollPane and all its descendants. |
void | setColumnHeader(JViewport x)
Sets a column-header viewport |
void | setColumnHeaderView(java.awt.Component view)
Creates a column-header viewport if neccessary and then sets its view. |
void | setCorner(java.lang.String key,
java.awt.Component x)
Sets the _________________, where the options for the key are:
|
void | setHorizontalScrollBarPolicy(int x)
|
void | setRowHeader(JViewport x)
Sets a row-header viewport. |
void | setRowHeaderView(java.awt.Component view)
Creates a row-header viewport if neccessary and then sets its view. |
void | setUI(com.sun.java.swing.plaf.ScrollPaneUI ui)
Sets the L&F object that renders this component. |
void | setVerticalScrollBarPolicy(int x)
|
void | setViewportBorder(Border viewportBorder)
Add a border around the viewport. |
void | setViewport(JViewport x)
Sets the current JViewport. |
void | setViewportView(java.awt.Component view)
Creates a viewport if neccessary and then sets its view. |
void | updateUI()
Notification from the UIManager that the L&F has changed. |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String[] cornerKeywords
Constructor Detail |
public JScrollPane(java.awt.Component view, int vsbPolicy, int hsbPolicy)
view
- the Component to display
vsbPolicy
- an int specifying the vertical scrollbar policy
hsbPolicy
- an int specifying the horizontal scrollbar policypublic JScrollPane(java.awt.Component view)
view
- the Component to displaypublic JScrollPane(int vsbPolicy, int hsbPolicy)
vsbPolicy
- an int specifying the vertical scrollbar policy
hsbPolicy
- an int specifying the horizontal scrollbar policypublic JScrollPane()
Method Detail |
public com.sun.java.swing.plaf.ScrollPaneUI getUI()
public void setUI(com.sun.java.swing.plaf.ScrollPaneUI ui)
ui
- the ScrollPaneUI L&F objectpublic void updateUI()
public java.lang.String getUIClassID()
public int getVerticalScrollBarPolicy()
public void setVerticalScrollBarPolicy(int x)
public int getHorizontalScrollBarPolicy()
public void setHorizontalScrollBarPolicy(int x)
public Border getViewportBorder()
public void setViewportBorder(Border viewportBorder)
The default value of this property is computed by the look and feel implementation.
This is a JavaBeans bound property.
public JScrollBar createHorizontalScrollBar()
public JScrollBar createVerticalScrollBar()
public JScrollBar getHorizontalScrollBar()
public JScrollBar getVerticalScrollBar()
protected JViewport createViewport()
setViewportView
,
setRowHeaderView
, and setColumnHeaderView
.
Subclasses may override this method to return a subclass of JViewport.public JViewport getViewport()
public void setViewport(JViewport x)
public void setViewportView(java.awt.Component view)
view
- the Component to viewpublic JViewport getRowHeader()
public void setRowHeader(JViewport x)
x
- the JViewport to use for a row headerpublic void setRowHeaderView(java.awt.Component view)
view
- the Component to display as the row headerpublic JViewport getColumnHeader()
public void setColumnHeader(JViewport x)
x
- the JViewport to use for the column headerpublic void setColumnHeaderView(java.awt.Component view)
view
- the Component to display as the column headerpublic java.awt.Component getCorner(java.lang.String key)
key
- a String specifying the cornerpublic void setCorner(java.lang.String key, java.awt.Component x)
key
- a String specifying the corner
x
- the Component _________________public boolean isOpaque()
public boolean isValidateRoot()
public AccessibleContext getAccessibleContext()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |