ScrollPane

Name

ScrollPane

[Graphic: Figure from the text]

Description

The ScrollPane class provides automatic scrolling of a child component.

Class Definition

public class java.awt.ScrollPane extends java.awt.Container {
 // Constants public final static int SCROLLBARS_ALWAYS;
public final static int SCROLLBARS_AS_NEEDED;
public final static int SCROLLBARS_NEVER; // Constructors public ScrollPane();
public ScrollPane (int scrollbarDisplayPolicy); // Public Instance Methods public void addNotify();
public void doLayout();
public Adjustable getHAdjustable();
public int getHScrollbarHeight();
public Point getScrollPosition();
public int getScrollbarDisplayPolicy();
public Adjustable getVAdjustable();
public int getVScrollbarWidth();
public Dimension getViewportSize();
public void layout(); (Deprecated) public String paramString();
public void printComponents (Graphics g);
public final void setLayout (LayoutManager mgr);
public void setScrollPosition (int x, int y);
public void setScrollPosition (Point p); //Protected Instance Methods protected final void addImpl (Component comp, Object constraints, int index);
}

Constants

SCROLLBARS_ALWAYS

public final static int SCROLLBARS_ALWAYS

Always show the scrollbars.

SCROLLBARS_AS_NEEDED

public final static int SCROLLBARS_AS_NEEDED

Only show the scrollbars if the contents of the ScrollPane are larger than what is visible.

SCROLLBARS_NEVER

public final static int SCROLLBARS_NEVER

Don't ever show the scrollbars. The ScrollPane can still be scrolled programmatically.

Constructors

ScrollPane

public ScrollPane()

public ScrollPane (int scrollbarDisplayPolicy)

Instance Methods

addImpl

protected final void addImpl (Component comp, Object constraints, int index)

addNotify

public void addNotify()

doLayout

public void doLayout()

getHAdjustable

public Adjustable getHAdjustable()

getHScrollbarHeight

public int getHScrollbarHeight()

getScrollPosition

public Point getScrollPosition()

getScrollbarDisplayPolicy

public int getScrollbarDisplayPolicy()

getVAdjustable

public Adjustable getVAdjustable()

getVScrollbarWidth

public int getVScrollbarWidth()

getViewportSize

public Dimension getViewportSize()

layout

public void layout() (Deprecated)

paramString

public String paramString()

printComponents

public void printComponents (Graphics g)

setLayout

public void setLayout (LayoutManager manager)

setScrollPosition

public void setScrollPosition (int x, int y)

public void setScrollPosition (Point p)

See Also

Adjustable, Container, Point, Scrollbar