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

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

Introduction

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

The text is from its open source code.

Subclass

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

Field

intBLIT_SCROLL_MODE
Use graphics.copyArea to implement scrolling.
intSIMPLE_SCROLL_MODE
This mode uses the very simple method of redrawing the entire contents of the scrollpane each time it is scrolled.

Constructor

JViewport()
Creates a JViewport.

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.
voidaddChangeListener(ChangeListener l)
Adds a ChangeListener to the list that is notified each time the view's size, position, or the viewport's extent size has changed.
ActionMapgetActionMap()
Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding.
RectanglegetBounds()
Gets the bounds of this component in the form of a Rectangle object.
ComponentgetComponent(int n)
Gets the nth component in this container.
Component[]getComponents()
Gets all the components in this container.
DimensiongetExtentSize()
Returns the size of the visible part of the view in view coordinates.
intgetHeight()
Returns the current height of this component.
InputMapgetInputMap(int condition)
Returns the InputMap that is used during condition.
ContainergetParent()
Gets the parent of this component.
ComponentgetView()
Returns the JViewport's one child or null.
PointgetViewPosition()
Returns the view coordinates that appear in the upper left hand corner of the viewport, or 0,0 if there's no view.
RectanglegetViewRect()
Returns a rectangle whose origin is getViewPosition and size is getExtentSize.
DimensiongetViewSize()
If the view's size hasn't been explicitly set, return the preferred size, otherwise return the view's current size.
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.
voidpaint(Graphics g)
Depending on whether the backingStore is enabled, either paint the image through the backing store or paint just the recently exposed part, using the backing store to "blit" the remainder.
voidscrollRectToVisible(Rectangle contentRect)
Scrolls the view so that Rectangle within the view becomes visible.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetMaximumSize(Dimension maximumSize)
Sets the maximum size of this component to a constant value.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetScrollMode(int mode)
Used to control the method of scrolling the viewport contents.
voidsetView(Component view)
Sets the JViewport's one lightweight child (view), which can be null.
voidsetViewPosition(Point p)
Sets the view coordinates that appear in the upper left hand corner of the viewport, does nothing if there's no view.
voidsetViewSize(Dimension newSize)
Sets the size of the view.
DimensiontoViewCoordinates(Dimension size)
Converts a size in pixel coordinates to view coordinates.
PointtoViewCoordinates(Point p)
Converts a point in pixel coordinates to view coordinates.