在Swing应用程序中,某些UI操作事件在执行 和UI时滞后,并冻结了几秒钟。当尝试检查使用Java事件队列被延迟并持有监视器几秒钟
ThreadInfo MonitorInfo[] monitors = threadInfo.getLockedMonitors();
和
StackTraceElement[] stackElements = threadInfo.getStackTrace();
显示器和连续线..到组件。
这只发生在webstart
例如:
**HOLDS MONITORS:** [[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected]]
STACK TRACE:
java.util.zip.Inflater.inflateBytes(Native Method)
java.util.zip.Inflater.inflate(Unknown Source)
java.util.zip.InflaterInputStream.read(Unknown Source)
java.util.jar.JarVerifier$VerifierStream.read(Unknown Source)
com.sun.deploy.security.JarVerifier.readAndMaybeSaveStreamTo(Unknown
Source)
com.sun.deploy.security.JarVerifier.authenticateJarEntry(Unknown Source)
com.sun.deploy.security.EnhancedJarVerifier.validate(Unknown Source)
com.sun.deploy.cache.CacheEntry$3.run(Unknown Source)
com.sun.deploy.cache.CacheEntry$3.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
com.sun.deploy.cache.CacheEntry.getJarSigningData(Unknown Source)
com.sun.deploy.cache.CachedJarFile.getSigningData(Unknown Source)
com.sun.deploy.cache.CachedJarFile$JarFileEntry.getCodeSigners(Unknown
Source)
com.sun.deploy.security.DeployURLClassPath$JarLoader$2.getCodeSigners(
Unknown Source)
java.net.URLClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.access$100(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
不要对非引用内容使用引号格式! –
使用SwingWorker将长时间运行/阻塞操作卸载到其他线程上下文(除了事件分派线程) – MadProgrammer