java - Adding scroolbar to JList(including DefaultListModel object ) -


i trying add scrollbar jlist , have searched in site there lot of thing topic when ı try referenced questions , of them has worked.my code here.

  list = new jlist();   list.setvisiblerowcount(1000);    model = new defaultlistmodel<string>();   list.setmodel(model);   jscrollpane scrollpane = new jscrollpane();   scrollpane.setviewportview(list); 

how can add scrollbar jlist? can me question?

how can ı add scroolbar jlist?anybody can me question?

the scrollbar appear automatically when number of elements in list greater size of scroll pane.

i'm guessing setvisiblerowcount(...) method nothing because didn't add data listmodel. since there nothing render size 0. using row count of 1000 makes no sense since can't display 1000 of lines of data on single page. property meant reasonable value 10 can see 10 items of data @ 1 time when have 100 items in list.

post sscce demonstrates problem (once add data model , make row count reasonable) if need more help.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -