Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a scroll bar to a JList? [closed]

Tags:

java

swing

How do you add a JList to a JScrollPane ?

like image 915
hiii Avatar asked Mar 20 '13 11:03

hiii


1 Answers

Put your JList in a JScrollPane

JScrollPane scrollPane = new JScrollPane();
JList list = new JList();
scrollPane.setViewportView(list);
like image 172
Apurv Avatar answered Nov 11 '22 18:11

Apurv