Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make JFrame or JPanel Scrollable

i have added multiple component on JPanel & then i add JPanel on JFrame.

how to make window scrollable ?

so i can add more component at that frame or window .

like image 417
Laxman More Avatar asked Dec 11 '22 11:12

Laxman More


1 Answers

Before adding your JPanel, put in a JScrollPane first:

JPanel panel = ...;
JScrollPane scroll = new JScrollPane(panel);
frame.add(scroll, ...);
like image 87
Josh M Avatar answered Jan 02 '23 01:01

Josh M