0

Hello guys,

I don't really need a solution, just answer - some Swing insight. So I have a panel, and a list on it. The list is populated with strings. The problem is the following: If I add the list elements too fast, I end up with different kinds of strange windows. However, after introducing a sleep(100), or another function call, it surprisingly works fine. I didn't believe this was the problem, so I added and removed the sleep several times. It solved the glitch 10/10.

How? Why? Ideas and guessings are welcome as well.

Thanks in advance,
Chaster

Edited by Chaster: n/a

3
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by quuba
0

Swing lib use threading to Draw as you may knew , can you please post the code .

0

Swing lib use threading to Draw as you may knew , can you please post the code .

It's kind of confidential. I just hoped someone came across the same issue ;). Actually it's nothing special about the code. It's not multi-threaded, I just add several entries to the list.

0

1.What about model of JList?
2.Forced repaint() method?

1.) Default
2.) Repainted after each update

0

Your code looks like this?
JList list;
/////
DefaultListModel model = new DefaultListModel();
list = new JList(model) ;

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.