Skip to main content

Please review fix for CR 6675728

4 replies [Last post]
sergey_borodin
Offline
Joined: 2006-10-20

Please review fix for CR 6675527.

This is some strange swing bug, hard to reproduce. Those guys, who found it, suggested this fix. If there is no objections, I will integrate it.

diffs are:
https://jtharness.dev.java.net/source/browse/jtharness?rev=870&view=rev

Thanks,
Sergey

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bkurotsu
Offline
Joined: 2004-12-13

Sergey - I noted in the bug... I don't think it's appropriate to just add a repaint. I think the root cause should be investigated. Are you saying that you cannot reproduce it?

kromanovs
Offline
Joined: 2007-11-14

We reproduced that on every our Windows boxes. So it can be platform-dependent, but really think the repaint(); is needed there.

I just talked to a guy who develops Swing, asked him to take a look at this issue. He said that revalidate(); is not enough. This is just a message to LayoutManager to update components and it's not guaranteed that repaint would occur.

He said we may take a look into implementation of JComponent as a reference. Look for example at #setFont(Font) or #setUI(ComponentUI) methods - you can find that those methods call a sequence:
revalidate();
repaint();

So this is a recommended way.

bkurotsu
Offline
Joined: 2004-12-13

Ok, Sergey, go ahead then. Thanks!

sergey_borodin
Offline
Joined: 2006-10-20

Integrated