-1

What are the differences between JScrollBar and JScrollPane?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Sachin Kumar
  • 781
  • 1
  • 9
  • 28

1 Answers1

7

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

nachokk
  • 14,363
  • 4
  • 24
  • 53