JList inside JScrollPane is not displaying
Hello. I've got a problem with a JList. I create a JScrollPane and place my JList inside it, then set the preferred size of the JScrollPane. When the GUI is shown, my JScrollPane is visible and has the correct size, however, the JList appears to have zero width and height (according to the debugger). When I add elements to JList's model they are added correctly, but the list is still invisible.
Here's some code.
In the panel constructor (it has a BorderLayout, and the JScrollPane with my list is added to the left side):
Here is what it looks like:
pictures = new DefaultListModel();
picList = new JList(pictures);
JScrollPane pPic = new JScrollPane(picList);
pPic.setPreferredSize(new Dimension(200, 0));
As you can see, there's an empty space on the left side, where my list is supposed to be. Thank you very much for any help.