Java javax.swing JScrollPane fields, constructors, methods, implement or subclass

Example usage for Java javax.swing JScrollPane fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing JScrollPane.

The text is from its open source code.

Subclass

javax.swing.JScrollPane has subclasses.
Click this link to see all its subclasses.

Constructor

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.

Method

Componentadd(Component comp)
Appends the specified component to the end of this container.
Componentadd(String name, Component comp)
Adds the specified component to this container.
voidaddComponentListener(ComponentListener l)
Adds the specified component listener to receive component events from this component.
voidaddKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component.
voidaddMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component.
voidaddMouseWheelListener(MouseWheelListener l)
Adds the specified mouse wheel listener to receive mouse wheel events from this component.
voidapplyComponentOrientation(ComponentOrientation o)
Sets the ComponentOrientation property of this container and all components contained within it.
JScrollBarcreateHorizontalScrollBar()
Returns a JScrollPane.ScrollBar by default.
JScrollBarcreateVerticalScrollBar()
Returns a JScrollPane.ScrollBar by default.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
BordergetBorder()
Returns the border of this component or null if no border is currently set.
RectanglegetBounds()
Gets the bounds of this component in the form of a Rectangle object.
JViewportgetColumnHeader()
Returns the column header.
ComponentgetComponent(int n)
Gets the nth component in this container.
intgetHeight()
Returns the current height of this component.
JScrollBargetHorizontalScrollBar()
Returns the horizontal scroll bar that controls the viewport's horizontal view position.
intgetHorizontalScrollBarPolicy()
Returns the horizontal scroll bar policy value.
InsetsgetInsets()
If a border has been set on this component, returns the border's insets; otherwise calls super.getInsets.
DimensiongetMaximumSize()
If the maximum size has been set to a non-null value just returns it.
DimensiongetMinimumSize()
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.
DimensiongetPreferredSize()
If the preferredSize has been set to a non-null value just returns it.
DimensiongetSize()
Returns the size of this component in the form of a Dimension object.
JScrollBargetVerticalScrollBar()
Returns the vertical scroll bar that controls the viewports vertical view position.
intgetVerticalScrollBarPolicy()
Returns the vertical scroll bar policy value.
JViewportgetViewport()
Returns the current JViewport.
RectanglegetVisibleRect()
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.
intgetWidth()
Returns the current width of this component.
voidinvalidate()
Invalidates the container.
voidpaint(Graphics g)
Invoked by Swing to draw components.
voidputClientProperty(Object key, Object value)
Adds an arbitrary key/value "client property" to this component.
voidremoveComponentListener(ComponentListener l)
Removes the specified component listener so that it no longer receives component events from this component.
voidrepaint()
Repaints this component.
voidrevalidate()
Supports deferred automatic layout.
voidscrollRectToVisible(Rectangle aRect)
Forwards the scrollRectToVisible() message to the JComponent's parent.
voidsetActionMap(ActionMap am)
Sets the ActionMap to am.
voidsetAlignmentX(float alignmentX)
Sets the horizontal alignment.
voidsetAutoscrolls(boolean autoscrolls)
Sets the autoscrolls property.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetBorder(Border border)
Sets the border of this component.
voidsetBounds(int x, int y, int width, int height)
Moves and resizes this component.
voidsetBounds(Rectangle r)
Moves and resizes this component to conform to the new bounding rectangle r .
voidsetColumnHeader(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.
voidsetColumnHeaderView(Component view)
Creates a column-header viewport if necessary, sets its view, and then adds the column-header viewport to the scrollpane.
voidsetComponentOrientation(ComponentOrientation co)
Sets the orientation for the vertical and horizontal scrollbars as determined by the ComponentOrientation argument.
voidsetComponentPopupMenu(JPopupMenu popup)
Sets the JPopupMenu for this JComponent.
voidsetComponentZOrder(Component comp, int index)
Moves the specified component to the specified z-order index in the container.
voidsetCorner(String key, Component corner)
Adds a child that will appear in one of the scroll panes corners, if there's room.
voidsetDoubleBuffered(boolean aFlag)
Sets whether this component should use a buffer to paint.
voidsetFocusable(boolean focusable)
Sets the focusable state of this Component to the specified value.
voidsetFont(Font font)
Sets the font for this component.
voidsetHorizontalScrollBar(JScrollBar horizontalScrollBar)
Adds the scrollbar that controls the viewport's horizontal view position to the scrollpane.
voidsetHorizontalScrollBarPolicy(int policy)
Determines when the horizontal scrollbar appears in the scrollpane.
voidsetLayout(LayoutManager layout)
Sets the layout manager for this JScrollPane.
voidsetLocation(int x, int y)
Moves this component to a new location.
voidsetMaximumSize(Dimension maximumSize)
Sets the maximum size of this component to a constant value.
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.
voidsetName(String name)
Sets the name of the component to the specified string.
voidsetOpaque(boolean isOpaque)
If true the component paints every pixel within its bounds.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetRowHeader(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.
voidsetRowHeaderView(Component view)
Creates a row-header viewport if necessary, sets its view and then adds the row-header viewport to the scrollpane.
voidsetSize(Dimension d)
Resizes this component so that it has width d.width and height d.height .
voidsetSize(int width, int height)
Resizes this component so that it has width width and height height .
voidsetToolTipText(String text)
Registers the text to display in a tool tip.
voidsetTransferHandler(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.
voidsetVerticalScrollBar(JScrollBar verticalScrollBar)
Adds the scrollbar that controls the viewports vertical view position to the scrollpane.
voidsetVerticalScrollBarPolicy(int policy)
Determines when the vertical scrollbar appears in the scrollpane.
voidsetViewport(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.
voidsetViewportBorder(Border viewportBorder)
Adds a border around the viewport.
voidsetViewportView(Component view)
Creates a viewport if necessary and then sets its view.
voidsetVisible(boolean aFlag)
Makes the component visible or invisible.
voidsetWheelScrollingEnabled(boolean handleWheel)
Enables/disables scrolling in response to movement of the mouse wheel.
voidvalidate()
Validates this container and all of its subcomponents.