The object of JScrollbar class is used to add horizontal and vertical scrollbar. It is an implementation of a scrollbar. It inherits JComponent class.
Let's see the declaration for javax.swing.JScrollBar class.
| Constructor | Description |
|---|---|
| JScrollBar() | Creates a vertical scrollbar with the initial values. |
| JScrollBar(int orientation) | Creates a scrollbar with the specified orientation and the initial values. |
| JScrollBar(int orientation, int value, int extent, int min, int max) | Creates a scrollbar with the specified orientation, value, extent, minimum, and maximum. |
Output:

Output:

We request you to subscribe our newsletter for upcoming updates.