1 |
A ScrollPane provides a scrollable area within an existing window. It is a container which can have one other component added to it. This component may have a larger area that will be visible in the ScrollPane. For example, suppose that you have a Canvas drawing area that is 1000 by 1000 pixels wide. You can define a ScrollPane that will view part of it at one time.
-
Canvas draw = new Canvas();
-
draw.setSize (1000, 1000);
-
ScrollPane drawscroller = new ScrollPane();
-
drawscroller.add (draw);
-
drawscroller.setSize (250, 250);
-
add(drawscroller);
|