aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/Launcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'netx/net/sourceforge/jnlp/Launcher.java')
-rw-r--r--netx/net/sourceforge/jnlp/Launcher.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/netx/net/sourceforge/jnlp/Launcher.java b/netx/net/sourceforge/jnlp/Launcher.java
index 6e07b22..6076267 100644
--- a/netx/net/sourceforge/jnlp/Launcher.java
+++ b/netx/net/sourceforge/jnlp/Launcher.java
@@ -31,8 +31,8 @@ import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import net.sourceforge.jnlp.util.JarFile;
+import net.sourceforge.jnlp.util.JarFile;
import net.sourceforge.jnlp.cache.CacheUtil;
import net.sourceforge.jnlp.cache.UpdatePolicy;
import net.sourceforge.jnlp.runtime.AppletInstance;
@@ -44,9 +44,10 @@ import net.sourceforge.jnlp.services.ServiceUtil;
import javax.swing.SwingUtilities;
import javax.swing.text.html.parser.ParserDelegator;
+
import net.sourceforge.jnlp.splashscreen.SplashUtils;
import net.sourceforge.jnlp.util.logging.OutputController;
-
+import sun.awt.AppContext;
import sun.awt.SunToolkit;
/**
@@ -67,6 +68,8 @@ public class Launcher {
/** shared thread group */
/*package*/static final ThreadGroup mainGroup = new ThreadGroup(R("LAllThreadGroup"));
+
+ public static ThreadGroup getMainGroup() { return mainGroup; }
/** the handler */
private LaunchHandler handler = null;
@@ -521,12 +524,16 @@ public class Launcher {
// When the application-desc field is empty, we should take a
// look at the main jar for the main class.
if (mainName == null) {
- JARDesc mainJarDesc = file.getResources().getMainJAR();
- File f = CacheUtil.getCacheFile(mainJarDesc.getLocation(), null);
+ final JARDesc mainJarDesc = file.getResources().getMainJAR();
+ final File f = CacheUtil.getCacheFile(mainJarDesc.getLocation(), null);
if (f != null) {
- JarFile mainJar = new JarFile(f);
- mainName = mainJar.getManifest().
- getMainAttributes().getValue("Main-Class");
+ final JarFile mainJar = new JarFile(f);
+ try {
+ mainName = mainJar.getManifest().
+ getMainAttributes().getValue("Main-Class");
+ } finally {
+ mainJar.close();
+ }
}
}
@@ -767,7 +774,7 @@ public class Launcher {
JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy);
ThreadGroup group = Thread.currentThread().getThreadGroup();
- ApplicationInstance app = new ApplicationInstance(file, group, loader);
+ ApplicationInstance app = new ApplicationInstance(file, group, loader, AppContext.getAppContext());
loader.setApplication(app);
return app;