How to make JFrame or JPanel scrollable

I added some components to JPanel and then add JPanel to the JFrame.

how to make a window scrollable?

so I can add more components to this frame or window.

+4
source share
2 answers

Before adding a JPanel , first insert a JScrollPane :

 JPanel panel = ...; JScrollPane scroll = new JScrollPane(panel); frame.add(scroll, ...); 
+11
source

Just put your JPanel in a JScrollPane and add it to a JFrame to do the trick ....

+3
source

Source: https://habr.com/ru/post/1501852/


All Articles