This is irritating me so bad, I have spent three hours aimlessly trying to get JScrollPane to work on my JList and I can't figure it out.. here is the code, please make the scroll bars work! :sad:
public class ChatServer extends JPanel {
private JList lstUsers;
private JScrollPane scroller;
public ChatServer() {
lstUsers = new JList (lstUsersItems);
scroller = new JScrollPane(lstUsers);
setPreferredSize (new Dimension (646, 556));
setLayout (null);
add (lstUsers);
lstUsers.setBounds (240, 35, 200, 230);
lstUsers.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
add(scrollPane, BorderLayout.CENTER);
}
}
I have no idea, and after several tutorials and many many syntax changes, it still doesn't work.. Sometimes the JList won't even appear on my form, sometimes it will without a scroll bar and will be uneditable.. The rest of teh code is irrelivant, but it is a chatServer I am writing.. Comming along wonderfully, except for this one little thing.. :cry: