Hi,

I am having trouble displaying a scrollable JList. I wrapped it in a JScrollPane,
but I can't get it to display. When I add the component to a JPanel, do
I add the Jlist or the JScrollPane? Do I need a JScrollBar object? Please
help. Thanks.

Here is my code:

private JPanel panelAreas = new JPanel(null);
private JList areaRestrictedAreas = new JList();
private JScrollPane restrictedScrollPane = new JScrollPane(areaRestrictedAreas);
private JScrollBar restrictedScrollBar = new JScrollBar();

restrictedScrollPane.setVerticalScrollBar(restrictedScrollBar);
panelAreas.add(restrictedScrollPane);
panelAreas.add(restrictedScrollBar);