Синхронизация потоков при выводе графики
This commit is contained in:
parent
25889306bb
commit
d9e1fb9d16
@ -38,8 +38,10 @@ public class PaintPanel extends JPanel {
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
for (PaintableObject paintable : paintables) {
|
||||
paintable.draw(g);
|
||||
synchronized (paintables) {
|
||||
for (PaintableObject paintable : paintables) {
|
||||
paintable.draw(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user