Great minds must think alike I was investigating the same and came up with this.
JScrollPane sp = new JScrollPane(this.variables = new JList());
this.varList = new Vector();
this.variables.setVisibleRowCount(5);
this.add(sp);
The problem was that setVisibleRowCount only works when the JList...
I am dynamically adding items to a JList (using setListData) but only want 5 to show at a time. I have tried using setVisibleRowCount(5) but it doesn't work. I even tried some Sys outs to see if the method worked and sure enough it tells me that the visible row count is 5 but I still have a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.