Scrollbars in JList

Hi All,
I am using one JList bean component on my Application.
Can any one please help me How to add scrollbars in the JList .

Thanks in advance.

This is not a Servoy component. Have a look here: http://java.sun.com/docs/books/tutorial … /list.html

Hello,

Drop your JList inside a JScrollPane bean. It will take care of the issue.

myScrollPane = new Packages.javax.swing.JScrollPane(elements.myJListBean);

Thanks Patrick and jbader,

I have done coding same as mentioned by you .

I have used

var listScroller = new Packages.javax.swing.JScrollPane(elements.bean_list);

listScroller.setPreferredSize(new Packages.java.awt.Dimension(250, 80));

Now, before this my jList was working without scrollbar .

after adding the above code. it is not showing the JList .

If I comment this two lines then it is working .

Also it is not showing any error on servoy log

Try with this, Hope it will work…

var aArr = new Array("1","2","3","4","5");

elements.JList.setListData(aArr);

var vp = elements.JScrollPane.viewport;
vp.add(elements.JList);

Before that, place JList & a JScrollPane on the form and execute the above code.

Hope it will help.

Thanks ars!

Now it is working fine. : :D