src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
@@ -58,10 +58,12 @@
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.BoxLayout;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+
import java.text.SimpleDateFormat;
import java.util.Date;
import j2dbench.tests.GraphicsTests;
import j2dbench.tests.ImageTests;
@@ -374,11 +376,15 @@
}
});
}
if (gui) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
startGUI();
+ }
+ });
} else {
long start = System.currentTimeMillis();
int nLoopCount = 1;
@@ -770,10 +776,11 @@
});
p.add(b);
f.getContentPane().add(p, BorderLayout.SOUTH);
f.pack();
+ f.setLocationRelativeTo(null);
f.show();
}
public static void runTests(boolean showresults) {
final TestEnvironment env = new TestEnvironment();