Example usage for Java javax.swing JViewport fields, constructors, methods, implement or subclass
The text is from its open source code.
int | BLIT_SCROLL_MODE Use graphics.copyArea to implement scrolling. |
int | SIMPLE_SCROLL_MODE This mode uses the very simple method of redrawing the entire contents of the scrollpane each time it is scrolled. |
JViewport() Creates a JViewport . |
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 | addChangeListener(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. |
ActionMap | getActionMap() Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding. |
Rectangle | getBounds() Gets the bounds of this component in the form of a Rectangle object. |
Component | getComponent(int n) Gets the nth component in this container. |
Component[] | getComponents() Gets all the components in this container. |
Dimension | getExtentSize() Returns the size of the visible part of the view in view coordinates. |
int | getHeight() Returns the current height of this component. |
InputMap | getInputMap(int condition) Returns the InputMap that is used during condition . |
Container | getParent() Gets the parent of this component. |
Component | getView() Returns the JViewport 's one child or null . |
Point | getViewPosition() Returns the view coordinates that appear in the upper left hand corner of the viewport, or 0,0 if there's no view. |
Rectangle | getViewRect() Returns a rectangle whose origin is getViewPosition and size is getExtentSize . |
Dimension | getViewSize() If the view's size hasn't been explicitly set, return the preferred size, otherwise return the view's current size. |
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 | paint(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. |
void | scrollRectToVisible(Rectangle contentRect) Scrolls the view so that Rectangle within the view becomes visible. |
void | setBackground(Color bg) Sets the background color of this component. |
void | setMaximumSize(Dimension maximumSize) Sets the maximum size of this component to a constant value. |
void | setPreferredSize(Dimension preferredSize) Sets the preferred size of this component. |
void | setScrollMode(int mode) Used to control the method of scrolling the viewport contents. |
void | setView(Component view) Sets the JViewport 's one lightweight child (view ), which can be null . |
void | setViewPosition(Point p) Sets the view coordinates that appear in the upper left hand corner of the viewport, does nothing if there's no view. |
void | setViewSize(Dimension newSize) Sets the size of the view. |
Dimension | toViewCoordinates(Dimension size) Converts a size in pixel coordinates to view coordinates. |
Point | toViewCoordinates(Point p) Converts a point in pixel coordinates to view coordinates. |