Question

What are the differences between JScrollBar and JScrollPane?

Was it helpful?

Solution

This image is self-explainatory

enter image description here

The JViewport provides a window, or "viewport" onto a data source -- for example, a text file. That data source is the "scrollable client" (aka data model) displayed by the JViewport view. A JScrollPane basically consists of JScrollBars, a JViewport, and the wiring between them, as shown in the diagram at right.

JScrollPane api

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top