当前位置: 首页 > 面试题库 >

进度栏更新崩溃javaFX

卫博
2023-03-14
问题内容

我的应用程序中出现JavaFX(jdk
1.8.0_91)上的一个讨厌的错误,该错误中显示并更新了几个进度条(随机或同时显示)。有时,尤其是在填充进度条时(它具有进度条的样式类),但有时甚至一无所获,软件块和该跟踪出现了几次(并非总是相同的数字,而是最后一次)一次是27次):

Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: -1

at java.util.ArrayList.elementData(ArrayList.java:418)

at java.util.ArrayList.get(ArrayList.java:431)

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:3577)

at javafx.scene.Node.getGeomBounds(Node.java:3530)

at javafx.scene.Node.getLocalBounds(Node.java:3478)

at javafx.scene.Node.updateTxBounds(Node.java:3641)

at javafx.scene.Node.getTransformedBounds(Node.java:3424)

at javafx.scene.Node.updateBounds(Node.java:559)

at javafx.scene.Parent.updateBounds(Parent.java:1719)

at javafx.scene.Parent.updateBounds(Parent.java:1717)

at javafx.scene.Parent.updateBounds(Parent.java:1717)

at javafx.scene.Parent.updateBounds(Parent.java:1717)

at javafx.scene.Parent.updateBounds(Parent.java:1717)

at javafx.scene.Parent.updateBounds(Parent.java:1717)

at javafx.scene.Parent.updateBounds(Parent.java:1717)

at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2404)

at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:354)

at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:381)

at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)

at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)

at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)

at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)

at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139)

at java.lang.Thread.run(Thread.java:745)

然后在这27条痕迹之后跟随着大量的此消息:

线程“ JavaFX应用程序线程”中的异常java.lang.ArrayIndexOutOfBoundsException

由于在异常堆栈跟踪中没有我自己的代码的迹象,所以我有点迷茫。有谁知道这可能来自哪里?


问题答案:

如果UI的修改不在JavaFX线程上,则该问题非常普遍。不幸的是,在这种情况下,您会得到一个数组索引超出范围的异常,并且没有真正的线索指出问题发生的位置。



 类似资料:
  • 我正在尝试更新到最新的LibGDX版本1.9.2(我已经使用了一段时间的旧版本),但是在创建了一个新的LibGDX项目并运行了默认的badlogic徽标应用程序之后,它在Android上崩溃了。我已经多次创建了新的LibGDX项目,没有出现任何问题,所以现在肯定有些不同了,因为这次它不起作用了。我的项目中没有错误,桌面项目工作正常,只是在我尝试运行Android项目时崩溃了。 我使用安装应用程序创

  • 获取crashpad的版本信息 libcc/src/third_party/crashpad/README.chromium将会有一个带有 校验和(checksum)的Revision:信息 检出到相应的分支 获取Google的奔溃报告 (https://chromium.googlesource.com/crashpad/crashpad), git clone https://chromium

  • 问题内容: 我的依赖: 但仍然:Google Play服务已过时。需要5208000但找到了5089036 这怎么可能? 更新这项工作: 要么 要么 问题答案: 如果您看不到任何更新,请等到设备上的Play商店更新Google Play服务。 Play商店-Google Play服务 或者,在Google上搜索并安装新的APK,或使用旧版本(如5.0.77或5.0.89)

  • 我最近把我的OSX更新到了最新的Yosemite版本,现在IntelliJ IDEA 13.1.4还没有开始。 我当前的Java版本: 看起来也没问题。

  • 问题内容: 我是Android编程的新手。当我将工具栏应用到我的应用程序时遇到了这个问题,当我尝试运行该应用程序时它崩溃了。这是代码: 这是我的 LogCat : 有人可以告诉我这是什么问题吗?我已经将appcompat_v7与我的项目一起包含了。谢谢。 问题答案: 您可以在logcat输出中看到答案: 不要请求Window.FEATURE_ACTION_BAR,而是在主题中将windowActi

  • 问题内容: 我正在Flask中构建一个相当简单的WebApp,该WebApp通过网站的API执行功能。我的用户使用他们的帐户URL和API令牌填写表单;当他们提交表单时,我有一个Python脚本,可通过API从其帐户中导出PDF。此功能可能需要很长时间,因此我想在表单页面上显示引导进度条,以指示脚本在过程中进行的进度。我的问题是函数运行时如何更新进度条?这是我在说的简化版本。 views.py: