Hence, the JScrollPane is used for another object of the Java Swing for which the value of JScrollBar is increased and decreased. getVerticalScrollBar(): This is method of JScrollPane class which is used to handle the vertical scrollbar of Java Swing.