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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user