小丸子子 2022-08-19 18:24
浏览 14
已结题

swing嵌套javafx总会抛出ArrayIndexOutOfBoundsException异常,窗口会卡死无法操作

swing嵌套javafx开发的桌面软件,运行一段时间文本框输入就会抛出异常

文本框没有任务事件,总会出现在些奇怪的问题。比如我输入11,文本框会显示1111

这样的问题也是偶尔出现,程序能正常运行,但是下边的错误会导致程序卡死,什么也操作不了

java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(ArrayList.java:422)
    at java.util.ArrayList.get(ArrayList.java:435)
    at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89)
    at com.sun.javafx.collections.VetoableListDecorator.get(VetoableListDecorator.java:306)
    at javafx.scene.Parent.updateCachedBounds(Parent.java:1591)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1535)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1388)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3579)
    at javafx.scene.Node.getGeomBounds(Node.java:3532)
    at javafx.scene.Node.computeLocalBounds(Node.java:3595)
    at javafx.scene.Node.updateLocalBounds(Node.java:3625)
    at javafx.scene.Node.getLocalBounds(Node.java:3486)
    at javafx.scene.Node.updateTxBounds(Node.java:3643)
    at javafx.scene.Node.getTransformedBounds(Node.java:3426)
    at javafx.scene.Node$MiscProperties$1.computeBounds(Node.java:6432)
    at javafx.scene.Node$LazyBoundsProperty.get(Node.java:9308)
    at javafx.scene.Node$LazyBoundsProperty.get(Node.java:9278)
    at javafx.scene.Node.getBoundsInParent(Node.java:3113)
    at com.sun.javafx.scene.control.skin.TextFieldSkin.getCharacterBounds(TextFieldSkin.java:689)
    at com.sun.javafx.scene.control.skin.TextInputControlSkin$11.getTextLocation(TextInputControlSkin.java:385)
    at com.sun.javafx.scene.control.skin.ComboBoxPopupControl$3.getTextLocation(ComboBoxPopupControl.java:483)
    at javafx.scene.Scene$InputMethodRequestsDelegate.getTextLocation(Scene.java:4011)
    at javafx.embed.swing.InputMethodSupport$InputMethodRequestsAdapter.getTextLocation(InputMethodSupport.java:61)
    at sun.awt.im.InputMethodContext.getTextLocation(InputMethodContext.java:278)
    at sun.awt.windows.WInputMethod$1.run(WInputMethod.java:588)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    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)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
有时候什么也没做,点击到输入框也会立马抛出异常,而且这个异常会一直在抛出,窗口直接卡死,直到我手动中止程序。
我没办法知道是因为什么原因导致的异常,异常抛出时间也不固定,有人知道是为什么吗?
  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 8月27日
    • 创建了问题 8月19日

    悬赏问题

    • ¥15 Kylin-Desktop-V10-GFB-Release-JICAI_02- 2207-Build14-ARM64.iso有没有这个版本的系统啊
    • ¥15 能不能通过蓝牙将传感器数据传送到手机上
    • ¥20 100元python和数据科学实验项目
    • ¥15 根据时间在调用出列表
    • ¥15 FastReport.community 编辑,table只显示“每页”最顶部和底部横线
    • ¥15 R 包chipseeker 安装失败
    • ¥15 Veeam Backup & Replication 9.5 还原问题
    • ¥15 vue-print-nb
    • ¥15 winfrom的datagridview下拉框变成了黑色,渲染不成功
    • ¥20 利用ntfy实现短信推送