aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge
diff options
context:
space:
mode:
authorDeepak Bhole <[email protected]>2011-10-27 18:24:46 -0400
committerDeepak Bhole <[email protected]>2011-10-27 18:24:46 -0400
commitda0c8484f75a0102514f9bc7b68c8f53440789eb (patch)
tree7551db2ebfdb9c11bfed487694229df359bb8ca2 /netx/net/sourceforge
parent0b7d179faf75ca7829093a508ba3352bfd6fa0e4 (diff)
PR778: Jar download and server certificate verification deadlock
Diffstat (limited to 'netx/net/sourceforge')
-rw-r--r--netx/net/sourceforge/jnlp/GuiLaunchHandler.java39
1 files changed, 30 insertions, 9 deletions
diff --git a/netx/net/sourceforge/jnlp/GuiLaunchHandler.java b/netx/net/sourceforge/jnlp/GuiLaunchHandler.java
index 90fe15c..371d302 100644
--- a/netx/net/sourceforge/jnlp/GuiLaunchHandler.java
+++ b/netx/net/sourceforge/jnlp/GuiLaunchHandler.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package net.sourceforge.jnlp;
+import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import javax.swing.SwingUtilities;
@@ -95,20 +96,40 @@ public class GuiLaunchHandler implements LaunchHandler {
@Override
public void launchInitialized(final JNLPFile file) {
+
+ int preferredWidth = 500;
+ int preferredHeight = 400;
+
+ final URL splashImageURL = file.getInformation().getIconLocation(
+ IconDesc.SPLASH, preferredWidth, preferredHeight);
+
+ if (splashImageURL != null) {
+ final ResourceTracker resourceTracker = new ResourceTracker(true);
+ resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, policy);
+ synchronized(mutex) {
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
+ }
+ });
+ } catch (InterruptedException ie) {
+ // Wait till splash screen is created
+ while (splashScreen == null);
+ } catch (InvocationTargetException ite) {
+ ite.printStackTrace();
+ }
+
+ splashScreen.setSplashImageURL(splashImageURL);
+ }
+ }
+
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- final int preferredWidth = 500;
- final int preferredHeight = 400;
-
- URL splashImageURL = file.getInformation().getIconLocation(
- IconDesc.SPLASH, preferredWidth, preferredHeight);
if (splashImageURL != null) {
- ResourceTracker resourceTracker = new ResourceTracker(true);
- resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, policy);
synchronized(mutex) {
- splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
- splashScreen.setSplashImageURL(splashImageURL);
if (splashScreen.isSplashScreenValid()) {
splashScreen.setVisible(true);
}