How to make JScrollBar to scroll?
Solution 1:
Try to take a Panel
and add components to that Panel
and set the JScrollPane
to that panel and add that to your Frame
.
JScrollPane scrollPane = new JScrollPane(yourPanel);
yourFrame.add(scrollPane, BorderLayout.CENTER);
Better to add the scrollpane
to the CENTER, so that it will get all the space available to yourFrame.