I'm baffled. With extensive testing I can confirm that if I add objects faster than y to the DefaultListModel connected to the JList, the JList dissapears.
Here's what I'm doing:
JPanel pane = new JPanel(new BorderLayout());
JList<LogMessage> messageList = new JList<LogMessage>(dataModel.getMessageList());
pane.add(messageList , BorderLayout.CENTER);
//add pane to JFrame etc.
After initializing the GUI I add 100 LogMessages to the DefaultListModel. What's strange is that everything works if I do Thread.sleep(10); between each of the 100 new LogMessages. If I don't - the JList vanishes.
I tried to export as a runnable jar and run it - the problem was gone. I still need to be able to run run my programs from eclipse though.
What could be causing this?