Changed the way fonts are initialized, hoping to reduce a chance of

dialogs hanging
This commit is contained in:
Branislav Stojkovic
2018-12-24 09:18:15 +01:00
parent fb0dc31b98
commit b0e986b4f9
3 changed files with 19 additions and 11 deletions
@@ -28,6 +28,7 @@ import java.util.Properties;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
@@ -114,16 +115,19 @@ public class DIYLCStarter {
LOG.error("Could not set Look&Feel", e);
}
// Thread fontThread = new Thread(new Runnable() {
//
// @Override
// public void run() {
// LOG.debug("Starting font pre-loading");
// FontChooserComboBox box = new FontChooserComboBox();
// LOG.debug("Finished font pre-loading");
// }
// });
// fontThread.start();
Thread fontThread = new Thread(new Runnable() {
@Override
public void run() {
LOG.debug("Starting font pre-loading");
FontChooserComboBox box = new FontChooserComboBox();
box.getPreferredSize();
JPanel p = new JPanel();
box.paint(p.getGraphics());
LOG.debug("Finished font pre-loading");
}
});
fontThread.start();
String val = System.getProperty(SCRIPT_RUN);
if (!"true".equals(val)) {