Fix crash in ClienUI configChanged event

Fix crash that can happen when ConfigChanged event arrives to ClientUI
and pack method is called in the event thread. Move swing/awt related
calls to swing thread to avoid this issue.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-02-24 22:11:43 +01:00
parent f4bdfeec13
commit 2efce3646e

View File

@@ -269,6 +269,8 @@ public class ClientUI extends JFrame
Dimension size = new Dimension(width, height); Dimension size = new Dimension(width, height);
SwingUtilities.invokeLater(() ->
{
client.setSize(size); client.setSize(size);
client.setPreferredSize(size); client.setPreferredSize(size);
@@ -279,6 +281,7 @@ public class ClientUI extends JFrame
{ {
pack(); pack();
} }
});
} }
private static void setUIFont(FontUIResource f) private static void setUIFont(FontUIResource f)