mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
progress icon shows in multiple places when scrolling
This commit is contained in:
committed by
Sergey Simonchik
parent
b35c04475b
commit
a0e69b8c7c
@@ -71,7 +71,7 @@ public class AsyncProcessIcon extends AnimatedIcon {
|
||||
return icons;
|
||||
}
|
||||
|
||||
public void updateLocation(JComponent container) {
|
||||
public void updateLocation(final JComponent container) {
|
||||
final Rectangle rec = container.getVisibleRect();
|
||||
|
||||
final Dimension iconSize = getPreferredSize();
|
||||
@@ -79,7 +79,14 @@ public class AsyncProcessIcon extends AnimatedIcon {
|
||||
final Rectangle newBounds = new Rectangle(rec.x + rec.width - iconSize.width, rec.y, iconSize.width, iconSize.height);
|
||||
if (!newBounds.equals(getBounds())) {
|
||||
setBounds(newBounds);
|
||||
container.repaint();
|
||||
// painting problems with scrollpane
|
||||
// repaint shouldn't be called from paint method
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
container.repaint();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user