javax.swing
Class JViewport

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Component sample code for java.awt.Component definition code for java.awt.Component 
      extended by java.awt.Container sample code for java.awt.Container definition code for java.awt.Container 
          extended by javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent 
              extended by javax.swing.JViewport
All Implemented Interfaces:
ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , MenuContainer sample code for java.awt.MenuContainer definition code for java.awt.MenuContainer , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

public class JViewport
extends JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
implements Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

The "viewport" or "porthole" through which you see the underlying information. When you scroll, what moves is the viewport. It is like peering through a camera's viewfinder. Moving the viewfinder upwards brings new things into view at the top of the picture and loses things that were at the bottom.

By default, JViewport is opaque. To change this, use the setOpaque method.

NOTE:We have implemented a faster scrolling algorithm that does not require a buffer to draw in. The algorithm works as follows:

  1. The view and parent view and checked to see if they are JComponents, if they aren't, stop and repaint the whole viewport.
  2. If the viewport is obscured by an ancestor, stop and repaint the whole viewport.
  3. Compute the region that will become visible, if it is as big as the viewport, stop and repaint the whole view region.
  4. Obtain the ancestor Window's graphics and do a copyArea on the scrolled region.
  5. Message the view to repaint the newly visible region.
  6. The next time paint is invoked on the viewport, if the clip region is smaller than the viewport size a timer is kicked off to repaint the whole region.
In general this approach is much faster. Compared to the backing store approach this avoids the overhead of maintaining an offscreen buffer and having to do two copyAreas. Compared to the non backing store case this approach will greatly reduce the painted region.

This approach can cause slower times than the backing store approach when the viewport is obscured by another window, or partially offscreen. When another window obscures the viewport the copyArea will copy garbage and a paint event will be generated by the system to inform us we need to paint the newly exposed region. The only way to handle this is to repaint the whole viewport, which can cause slower performance than the backing store case. In most applications very rarely will the user be scrolling while the viewport is obscured by another window or offscreen, so this optimization is usually worth the performance hit when obscured.

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 applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane , Serialized Form

Nested Class Summary
protected  class JViewport.AccessibleJViewport sample code for javax.swing.JViewport.AccessibleJViewport definition code for javax.swing.JViewport.AccessibleJViewport
          This class implements accessibility support for the JViewport class.
protected  class JViewport.ViewListener sample code for javax.swing.JViewport.ViewListener definition code for javax.swing.JViewport.ViewListener
          A listener for the view.
 
Nested classes/interfaces inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
JComponent.AccessibleJComponent sample code for javax.swing.JComponent.AccessibleJComponent definition code for javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
Container.AccessibleAWTContainer sample code for java.awt.Container.AccessibleAWTContainer definition code for java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
Component.AccessibleAWTComponent sample code for java.awt.Component.AccessibleAWTComponent definition code for java.awt.Component.AccessibleAWTComponent , Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy definition code for java.awt.Component.BltBufferStrategy , Component.FlipBufferStrategy sample code for java.awt.Component.FlipBufferStrategy definition code for java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean backingStore sample code for javax.swing.JViewport.backingStore definition code for javax.swing.JViewport.backingStore
          Deprecated. As of Java 2 platform v1.3
static int BACKINGSTORE_SCROLL_MODE sample code for javax.swing.JViewport.BACKINGSTORE_SCROLL_MODE definition code for javax.swing.JViewport.BACKINGSTORE_SCROLL_MODE
          Draws viewport contents into an offscreen image.
protected  Image sample code for java.awt.Image definition code for java.awt.Image backingStoreImage sample code for javax.swing.JViewport.backingStoreImage definition code for javax.swing.JViewport.backingStoreImage
          The view image used for a backing store.
static int BLIT_SCROLL_MODE sample code for javax.swing.JViewport.BLIT_SCROLL_MODE definition code for javax.swing.JViewport.BLIT_SCROLL_MODE
          Use graphics.copyArea to implement scrolling.
protected  boolean isViewSizeSet sample code for javax.swing.JViewport.isViewSizeSet definition code for javax.swing.JViewport.isViewSizeSet
          True when the viewport dimensions have been determined.
protected  Point sample code for java.awt.Point definition code for java.awt.Point lastPaintPosition sample code for javax.swing.JViewport.lastPaintPosition definition code for javax.swing.JViewport.lastPaintPosition
          The last viewPosition that we've painted, so we know how much of the backing store image is valid.
protected  boolean scrollUnderway sample code for javax.swing.JViewport.scrollUnderway definition code for javax.swing.JViewport.scrollUnderway
          The scrollUnderway flag is used for components like JList.
static int SIMPLE_SCROLL_MODE sample code for javax.swing.JViewport.SIMPLE_SCROLL_MODE definition code for javax.swing.JViewport.SIMPLE_SCROLL_MODE
          This mode uses the very simple method of redrawing the entire contents of the scrollpane each time it is scrolled.
 
Fields inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
accessibleContext sample code for javax.swing.JComponent.accessibleContext definition code for javax.swing.JComponent.accessibleContext , listenerList sample code for javax.swing.JComponent.listenerList definition code for javax.swing.JComponent.listenerList , TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY , ui sample code for javax.swing.JComponent.ui definition code for javax.swing.JComponent.ui , UNDEFINED_CONDITION sample code for javax.swing.JComponent.UNDEFINED_CONDITION definition code for javax.swing.JComponent.UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT sample code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT definition code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED sample code for javax.swing.JComponent.WHEN_FOCUSED definition code for javax.swing.JComponent.WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW sample code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW definition code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
BOTTOM_ALIGNMENT sample code for java.awt.Component.BOTTOM_ALIGNMENT definition code for java.awt.Component.BOTTOM_ALIGNMENT , CENTER_ALIGNMENT sample code for java.awt.Component.CENTER_ALIGNMENT definition code for java.awt.Component.CENTER_ALIGNMENT , LEFT_ALIGNMENT sample code for java.awt.Component.LEFT_ALIGNMENT definition code for java.awt.Component.LEFT_ALIGNMENT , RIGHT_ALIGNMENT sample code for java.awt.Component.RIGHT_ALIGNMENT definition code for java.awt.Component.RIGHT_ALIGNMENT , TOP_ALIGNMENT sample code for java.awt.Component.TOP_ALIGNMENT definition code for java.awt.Component.TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver
ABORT sample code for java.awt.image.ImageObserver.ABORT definition code for java.awt.image.ImageObserver.ABORT , ALLBITS sample code for java.awt.image.ImageObserver.ALLBITS definition code for java.awt.image.ImageObserver.ALLBITS , ERROR sample code for java.awt.image.ImageObserver.ERROR definition code for java.awt.image.ImageObserver.ERROR , FRAMEBITS sample code for java.awt.image.ImageObserver.FRAMEBITS definition code for java.awt.image.ImageObserver.FRAMEBITS , HEIGHT sample code for java.awt.image.ImageObserver.HEIGHT definition code for java.awt.image.ImageObserver.HEIGHT , PROPERTIES sample code for java.awt.image.ImageObserver.PROPERTIES definition code for java.awt.image.ImageObserver.PROPERTIES , SOMEBITS sample code for java.awt.image.ImageObserver.SOMEBITS definition code for java.awt.image.ImageObserver.SOMEBITS , WIDTH sample code for java.awt.image.ImageObserver.WIDTH definition code for java.awt.image.ImageObserver.WIDTH
 
Constructor Summary
JViewport sample code for javax.swing.JViewport.JViewport() definition code for javax.swing.JViewport.JViewport() ()
          Creates a JViewport.
 
Method Summary
 void addChangeListener sample code for javax.swing.JViewport.addChangeListener(javax.swing.event.ChangeListener) definition code for javax.swing.JViewport.addChangeListener(javax.swing.event.ChangeListener) (ChangeListener sample code for javax.swing.event.ChangeListener definition code for javax.swing.event.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.
protected  void addImpl sample code for javax.swing.JViewport.addImpl(java.awt.Component, java.lang.Object, int) definition code for javax.swing.JViewport.addImpl(java.awt.Component, java.lang.Object, int) (Component sample code for java.awt.Component definition code for java.awt.Component  child, Object sample code for java.lang.Object definition code for java.lang.Object  constraints, int index)
          Sets the JViewport's one lightweight child, which can be null.
protected  boolean computeBlit sample code for javax.swing.JViewport.computeBlit(int, int, java.awt.Point, java.awt.Point, java.awt.Dimension, java.awt.Rectangle) definition code for javax.swing.JViewport.computeBlit(int, int, java.awt.Point, java.awt.Point, java.awt.Dimension, java.awt.Rectangle) (int dx, int dy, Point sample code for java.awt.Point definition code for java.awt.Point  blitFrom, Point sample code for java.awt.Point definition code for java.awt.Point  blitTo, Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  blitSize, Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  blitPaint)
          Computes the parameters for a blit where the backing store image currently contains oldLoc in the upper left hand corner and we're scrolling to newLoc.
protected  LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager createLayoutManager sample code for javax.swing.JViewport.createLayoutManager() definition code for javax.swing.JViewport.createLayoutManager() ()
          Subclassers can override this to install a different layout manager (or null) in the constructor.
protected  JViewport.ViewListener sample code for javax.swing.JViewport.ViewListener definition code for javax.swing.JViewport.ViewListener createViewListener sample code for javax.swing.JViewport.createViewListener() definition code for javax.swing.JViewport.createViewListener() ()
          Creates a listener for the view.
protected  void firePropertyChange sample code for javax.swing.JViewport.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JViewport.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) (String sample code for java.lang.String definition code for java.lang.String  propertyName, Object sample code for java.lang.Object definition code for java.lang.Object  oldValue, Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
          Notifies listeners of a property change.
protected  void fireStateChanged sample code for javax.swing.JViewport.fireStateChanged() definition code for javax.swing.JViewport.fireStateChanged() ()
          Notifies all ChangeListeners when the views size, position, or the viewports extent size has changed.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for javax.swing.JViewport.getAccessibleContext() definition code for javax.swing.JViewport.getAccessibleContext() ()
          Gets the AccessibleContext associated with this JViewport.
 ChangeListener sample code for javax.swing.event.ChangeListener definition code for javax.swing.event.ChangeListener [] getChangeListeners sample code for javax.swing.JViewport.getChangeListeners() definition code for javax.swing.JViewport.getChangeListeners() ()
          Returns an array of all the ChangeListeners added to this JViewport with addChangeListener().
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getExtentSize sample code for javax.swing.JViewport.getExtentSize() definition code for javax.swing.JViewport.getExtentSize() ()
          Returns the size of the visible part of the view in view coordinates.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getInsets sample code for javax.swing.JViewport.getInsets() definition code for javax.swing.JViewport.getInsets() ()
          Returns the insets (border) dimensions as (0,0,0,0), since borders are not supported on a JViewport.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getInsets sample code for javax.swing.JViewport.getInsets(java.awt.Insets) definition code for javax.swing.JViewport.getInsets(java.awt.Insets) (Insets sample code for java.awt.Insets definition code for java.awt.Insets  insets)
          Returns an Insets object containing this JViewports inset values.
 int getScrollMode sample code for javax.swing.JViewport.getScrollMode() definition code for javax.swing.JViewport.getScrollMode() ()
          Returns the current scrolling mode.
 ViewportUI sample code for javax.swing.plaf.ViewportUI definition code for javax.swing.plaf.ViewportUI getUI sample code for javax.swing.JViewport.getUI() definition code for javax.swing.JViewport.getUI() ()
          Returns the L&F object that renders this component.
 String sample code for java.lang.String definition code for java.lang.String getUIClassID sample code for javax.swing.JViewport.getUIClassID() definition code for javax.swing.JViewport.getUIClassID() ()
          Returns a string that specifies the name of the L&F class that renders this component.
 Component sample code for java.awt.Component definition code for java.awt.Component getView sample code for javax.swing.JViewport.getView() definition code for javax.swing.JViewport.getView() ()
          Returns the JViewport's one child or null.
 Point sample code for java.awt.Point definition code for java.awt.Point getViewPosition sample code for javax.swing.JViewport.getViewPosition() definition code for javax.swing.JViewport.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 sample code for java.awt.Rectangle definition code for java.awt.Rectangle getViewRect sample code for javax.swing.JViewport.getViewRect() definition code for javax.swing.JViewport.getViewRect() ()
          Returns a rectangle whose origin is getViewPosition and size is getExtentSize.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getViewSize sample code for javax.swing.JViewport.getViewSize() definition code for javax.swing.JViewport.getViewSize() ()
          If the view's size hasn't been explicitly set, return the preferred size, otherwise return the view's current size.
 boolean isBackingStoreEnabled sample code for javax.swing.JViewport.isBackingStoreEnabled() definition code for javax.swing.JViewport.isBackingStoreEnabled() ()
          Deprecated. As of Java 2 platform v1.3, replaced by getScrollMode().
 boolean isOptimizedDrawingEnabled sample code for javax.swing.JViewport.isOptimizedDrawingEnabled() definition code for javax.swing.JViewport.isOptimizedDrawingEnabled() ()
          The JViewport overrides the default implementation of this method (in JComponent) to return false.
 void paint sample code for javax.swing.JViewport.paint(java.awt.Graphics) definition code for javax.swing.JViewport.paint(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.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.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.JViewport.paramString() definition code for javax.swing.JViewport.paramString() ()
          Returns a string representation of this JViewport.
 void remove sample code for javax.swing.JViewport.remove(java.awt.Component) definition code for javax.swing.JViewport.remove(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  child)
          Removes the Viewports one lightweight child.
 void removeChangeListener sample code for javax.swing.JViewport.removeChangeListener(javax.swing.event.ChangeListener) definition code for javax.swing.JViewport.removeChangeListener(javax.swing.event.ChangeListener) (ChangeListener sample code for javax.swing.event.ChangeListener definition code for javax.swing.event.ChangeListener  l)
          Removes a ChangeListener from the list that's notified each time the views size, position, or the viewports extent size has changed.
 void repaint sample code for javax.swing.JViewport.repaint(long, int, int, int, int) definition code for javax.swing.JViewport.repaint(long, int, int, int, int) (long tm, int x, int y, int w, int h)
          Always repaint in the parents coordinate system to make sure only one paint is performed by the RepaintManager.
 void reshape sample code for javax.swing.JViewport.reshape(int, int, int, int) definition code for javax.swing.JViewport.reshape(int, int, int, int) (int x, int y, int w, int h)
          Sets the bounds of this viewport.
 void scrollRectToVisible sample code for javax.swing.JViewport.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JViewport.scrollRectToVisible(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  contentRect)
          Scrolls the view so that Rectangle within the view becomes visible.
 void setBackingStoreEnabled sample code for javax.swing.JViewport.setBackingStoreEnabled(boolean) definition code for javax.swing.JViewport.setBackingStoreEnabled(boolean) (boolean enabled)
          Deprecated. As of Java 2 platform v1.3, replaced by setScrollMode().
 void setBorder sample code for javax.swing.JViewport.setBorder(javax.swing.border.Border) definition code for javax.swing.JViewport.setBorder(javax.swing.border.Border) (Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border  border)
          The viewport "scrolls" its child (called the "view") by the normal parent/child clipping (typically the view is moved in the opposite direction of the scroll).
 void setExtentSize sample code for javax.swing.JViewport.setExtentSize(java.awt.Dimension) definition code for javax.swing.JViewport.setExtentSize(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  newExtent)
          Sets the size of the visible part of the view using view coordinates.
 void setScrollMode sample code for javax.swing.JViewport.setScrollMode(int) definition code for javax.swing.JViewport.setScrollMode(int) (int mode)
          Used to control the method of scrolling the viewport contents.
 void setUI sample code for javax.swing.JViewport.setUI(javax.swing.plaf.ViewportUI) definition code for javax.swing.JViewport.setUI(javax.swing.plaf.ViewportUI) (ViewportUI sample code for javax.swing.plaf.ViewportUI definition code for javax.swing.plaf.ViewportUI  ui)
          Sets the L&F object that renders this component.
 void setView sample code for javax.swing.JViewport.setView(java.awt.Component) definition code for javax.swing.JViewport.setView(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  view)
          Sets the JViewport's one lightweight child (view), which can be null.
 void setViewPosition sample code for javax.swing.JViewport.setViewPosition(java.awt.Point) definition code for javax.swing.JViewport.setViewPosition(java.awt.Point) (Point sample code for java.awt.Point definition code for java.awt.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 sample code for javax.swing.JViewport.setViewSize(java.awt.Dimension) definition code for javax.swing.JViewport.setViewSize(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  newSize)
          Sets the size of the view.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension toViewCoordinates sample code for javax.swing.JViewport.toViewCoordinates(java.awt.Dimension) definition code for javax.swing.JViewport.toViewCoordinates(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  size)
          Converts a size in pixel coordinates to view coordinates.
 Point sample code for java.awt.Point definition code for java.awt.Point toViewCoordinates sample code for javax.swing.JViewport.toViewCoordinates(java.awt.Point) definition code for javax.swing.JViewport.toViewCoordinates(java.awt.Point) (Point sample code for java.awt.Point definition code for java.awt.Point  p)
          Converts a point in pixel coordinates to view coordinates.
 void updateUI sample code for javax.swing.JViewport.updateUI() definition code for javax.swing.JViewport.updateUI() ()
          Resets the UI property to a value from the current look and feel.
 
Methods inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
addAncestorListener sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) , addNotify sample code for javax.swing.JComponent.addNotify() definition code for javax.swing.JComponent.addNotify() , addVetoableChangeListener sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) , computeVisibleRect sample code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) definition code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) , contains sample code for javax.swing.JComponent.contains(int, int) definition code for javax.swing.JComponent.contains(int, int) , createToolTip sample code for javax.swing.JComponent.createToolTip() definition code for javax.swing.JComponent.createToolTip() , disable sample code for javax.swing.JComponent.disable() definition code for javax.swing.JComponent.disable() , enable sample code for javax.swing.JComponent.enable() definition code for javax.swing.JComponent.enable() , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) , fireVetoableChange sample code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) , getActionForKeyStroke sample code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) , getActionMap sample code for javax.swing.JComponent.getActionMap() definition code for javax.swing.JComponent.getActionMap() , getAlignmentX sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX() , getAlignmentY sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY() , getAncestorListeners sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners() , getAutoscrolls sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls() , getBorder sample code for javax.swing.JComponent.getBorder() definition code for javax.swing.JComponent.getBorder() , getBounds sample code for javax.swing.JComponent.getBounds(java.awt.Rectangle) definition code for javax.swing.JComponent.getBounds(java.awt.Rectangle) , getClientProperty sample code for javax.swing.JComponent.getClientProperty(java.lang.Object)