Example usage for Java javax.swing JScrollPane fields, constructors, methods, implement or subclass
The text is from its open source code.
JScrollPane(Component view) Creates 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() Creates an empty (no viewport view) JScrollPane where both horizontal and vertical scrollbars appear when needed. | |
JScrollPane(Component view, int vsbPolicy, int hsbPolicy) Creates a 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) Creates an empty (no viewport view) JScrollPane with specified scrollbar policies. |
Component | add(Component comp) Appends the specified component to the end of this container. |
Component | add(String name, Component comp) Adds the specified component to this container. |
void | addComponentListener(ComponentListener l) Adds the specified component listener to receive component events from this component. |
void | addKeyListener(KeyListener l) Adds the specified key listener to receive key events from this component. |
void | addMouseListener(MouseListener l) Adds the specified mouse listener to receive mouse events from this component. |
void | addMouseWheelListener(MouseWheelListener l) Adds the specified mouse wheel listener to receive mouse wheel events from this component. |
void | applyComponentOrientation(ComponentOrientation o) Sets the ComponentOrientation property of this container and all components contained within it. |
JScrollBar | createHorizontalScrollBar() Returns a JScrollPane.ScrollBar by default. |
JScrollBar | createVerticalScrollBar() Returns a JScrollPane.ScrollBar by default. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
Border | getBorder() Returns the border of this component or null if no border is currently set. |
Rectangle | getBounds() Gets the bounds of this component in the form of a Rectangle object. |
JViewport | getColumnHeader() Returns the column header. |
Component | getComponent(int n) Gets the nth component in this container. |
int | getHeight() Returns the current height of this component. |
JScrollBar | getHorizontalScrollBar() Returns the horizontal scroll bar that controls the viewport's horizontal view position. |
int | getHorizontalScrollBarPolicy() Returns the horizontal scroll bar policy value. |
Insets | getInsets() If a border has been set on this component, returns the border's insets; otherwise calls super.getInsets . |
Dimension | getMaximumSize() If the maximum size has been set to a non- null value just returns it. |
Dimension | getMinimumSize() If the minimum size has been set to a non- null value just returns it. |
MouseWheelListener[] | getMouseWheelListeners() Returns an array of all the mouse wheel listeners registered on this component. |
Dimension | getPreferredSize() If the preferredSize has been set to a non-null value just returns it. |
Dimension | getSize() Returns the size of this component in the form of a Dimension object. |
JScrollBar | getVerticalScrollBar() Returns the vertical scroll bar that controls the viewports vertical view position. |
int | getVerticalScrollBarPolicy() Returns the vertical scroll bar policy value. |
JViewport | getViewport() Returns the current JViewport . |
Rectangle | getVisibleRect() Returns the Component 's "visible rectangle" - the intersection of this component's visible rectangle, new Rectangle(0, 0, getWidth(), getHeight()) , and all of its ancestors' visible rectangles. |
int | getWidth() Returns the current width of this component. |
void | invalidate() Invalidates the container. |
void | paint(Graphics g) Invoked by Swing to draw components. |
void | putClientProperty(Object key, Object value) Adds an arbitrary key/value "client property" to this component. |
void | removeComponentListener(ComponentListener l) Removes the specified component listener so that it no longer receives component events from this component. |
void | repaint() Repaints this component. |
void | revalidate() Supports deferred automatic layout. |
void | scrollRectToVisible(Rectangle aRect) Forwards the scrollRectToVisible() message to the JComponent 's parent. |
void | setActionMap(ActionMap am) Sets the ActionMap to am . |
void | setAlignmentX(float alignmentX) Sets the horizontal alignment. |
void | setAutoscrolls(boolean autoscrolls) Sets the autoscrolls property. |
void | setBackground(Color bg) Sets the background color of this component. |
void | setBorder(Border border) Sets the border of this component. |
void | setBounds(int x, int y, int width, int height) Moves and resizes this component. |
void | setBounds(Rectangle r) Moves and resizes this component to conform to the new bounding rectangle r . |
void | setColumnHeader(JViewport columnHeader) Removes the old columnHeader, if it exists; if the new columnHeader isn't null , syncs the x coordinate of its viewPosition with the viewport (if there is one) and then adds it to the scroll pane. |
void | setColumnHeaderView(Component view) Creates a column-header viewport if necessary, sets its view, and then adds the column-header viewport to the scrollpane. |
void | setComponentOrientation(ComponentOrientation co) Sets the orientation for the vertical and horizontal scrollbars as determined by the ComponentOrientation argument. |
void | setComponentPopupMenu(JPopupMenu popup) Sets the JPopupMenu for this JComponent . |
void | setComponentZOrder(Component comp, int index) Moves the specified component to the specified z-order index in the container. |
void | setCorner(String key, Component corner) Adds a child that will appear in one of the scroll panes corners, if there's room. |
void | setDoubleBuffered(boolean aFlag) Sets whether this component should use a buffer to paint. |
void | setFocusable(boolean focusable) Sets the focusable state of this Component to the specified value. |
void | setFont(Font font) Sets the font for this component. |
void | setHorizontalScrollBar(JScrollBar horizontalScrollBar) Adds the scrollbar that controls the viewport's horizontal view position to the scrollpane. |
void | setHorizontalScrollBarPolicy(int policy) Determines when the horizontal scrollbar appears in the scrollpane. |
void | setLayout(LayoutManager layout) Sets the layout manager for this JScrollPane . |
void | setLocation(int x, int y) Moves this component to a new location. |
void | setMaximumSize(Dimension maximumSize) Sets the maximum size of this component to a constant value. |
void | setMinimumSize(Dimension minimumSize) Sets the minimum size of this component to a constant value. |
void | setName(String name) Sets the name of the component to the specified string. |
void | setOpaque(boolean isOpaque) If true the component paints every pixel within its bounds. |
void | setPreferredSize(Dimension preferredSize) Sets the preferred size of this component. |
void | setRowHeader(JViewport rowHeader) Removes the old rowHeader, if it exists; if the new rowHeader isn't null , syncs the y coordinate of its viewPosition with the viewport (if there is one) and then adds it to the scroll pane. |
void | setRowHeaderView(Component view) Creates a row-header viewport if necessary, sets its view and then adds the row-header viewport to the scrollpane. |
void | setSize(Dimension d) Resizes this component so that it has width d.width and height d.height . |
void | setSize(int width, int height) Resizes this component so that it has width width and height height . |
void | setToolTipText(String text) Registers the text to display in a tool tip. |
void | setTransferHandler(TransferHandler newHandler) Sets the TransferHandler , which provides support for transfer of data into and out of this component via cut/copy/paste and drag and drop. |
void | setVerticalScrollBar(JScrollBar verticalScrollBar) Adds the scrollbar that controls the viewports vertical view position to the scrollpane. |
void | setVerticalScrollBarPolicy(int policy) Determines when the vertical scrollbar appears in the scrollpane. |
void | setViewport(JViewport viewport) Removes the old viewport (if there is one); forces the viewPosition of the new viewport to be in the +x,+y quadrant; syncs up the row and column headers (if there are any) with the new viewport; and finally syncs the scrollbars and headers with the new viewport. |
void | setViewportBorder(Border viewportBorder) Adds a border around the viewport. |
void | setViewportView(Component view) Creates a viewport if necessary and then sets its view. |
void | setVisible(boolean aFlag) Makes the component visible or invisible. |
void | setWheelScrollingEnabled(boolean handleWheel) Enables/disables scrolling in response to movement of the mouse wheel. |
void | validate() Validates this container and all of its subcomponents. |