模拟器挂起,未连接到互联网时不显示任何错误

时间:2018-07-04 21:39:08

标签: codenameone

当互联网与我的笔记本电脑断开连接时,模拟器出现问题。有时,甚至菜单按钮也没有作用。 Agian立即开始工作,笔记本电脑连接到互联网。 Internet断开连接时,Connectivity.isConnected()方法在模拟器上是否有任何问题。请让我知道是否有类似问题。

在尝试使用菜单选项的日志中连接到互联网后,出现以下错误消息:

EDT violation detected!
EDT violation detected!
com.codename1.impl.javase.JavaSEPort$EDTViolation: EDT Violation Stack!
at com.codename1.impl.javase.JavaSEPort.checkEDT(JavaSEPort.java:699)
at com.codename1.impl.javase.JavaSEPort.createFont(JavaSEPort.java:5629)
at com.codename1.ui.Font.<init>(Font.java:99)
at com.codename1.ui.Font.createSystemFont(Font.java:345)
at com.codename1.ui.util.Resources.loadTheme(Resources.java:1351)
at com.codename1.ui.util.Resources.openFileImpl(Resources.java:305)
at com.codename1.ui.util.Resources.openFile(Resources.java:271)
at com.codename1.ui.util.Resources.<init>(Resources.java:191)
at com.codename1.ui.util.Resources.open(Resources.java:742)
at com.codename1.ui.util.Resources.open(Resources.java:679)
at com.codename1.impl.javase.ComponentTreeInspector.<init>(ComponentTreeInspector.java:75)
at com.codename1.impl.javase.JavaSEPort$18.actionPerformed(JavaSEPort.java:2682)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

enter image description here

1 个答案:

答案 0 :(得分:0)

您不应从启动/初始化开始使用该API。它可能在检查时阻止并有效地使您的应用崩溃。 start / init方法需要彻底完成执行。

组件检查器无法处理EDT线程,因此它违反了它。对于生产来说,这并不重要,因为您的设备上没有组件检查器...