进度条更新崩溃javaFX [英] Progress Bars update crash javaFX
问题描述
我在我的应用程序中发生了一个非常讨厌的JavaFX(jdk 1.8.0_91)错误,其中显示并更新了几个进度条(随机或同时)。有时候,特别是当一个进度条被填充时(它有一个进度条的样式类)但有时也没有任何东西,软件会阻塞并且我有几次出现这种痕迹(并不总是相同的数字,但是最后一个)一次是27次):
I have a pretty nasty bug on JavaFX (jdk 1.8.0_91) occurring in my application in which several progress bars are displayed and update (randomly or at the same time). Sometimes, especially when a progress bar is filled (it had a style class to the progress bar) but sometimes also in the middle of nothing, the software blocks and I have this trace appearing several times (not always the same number, but the last one was 27 times) :
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)
然后会有大量的这条消息:
The 27 traces are then followed by a huge amount of this message :
线程中的异常JavaFX Application Threadjava.lang.ArrayIndexOutOfBoundsException
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException
由于在异常堆栈跟踪中没有我自己的代码的迹象,我有点迷失。有没有人知道这可能来自哪里?
Since there is no sign of my own code in the exception stacktrace, I am a bit lost. Does anyone have an idea where this could come from ?
推荐答案
如果修改了UI,这个问题很常见在JavaFX线程上没有。不幸的是,在这种情况下,您会得到一个数组索引超出范围的异常,并且没有真正的线索来解决问题。
The issue is pretty common if there is a modification of the UI that is no on the JavaFX thread. Unfortunately in this case you get an Array Index out of bounds exception and no real clue where the issue happens.
另见(搜索结果为ObservableListWrapper.java:89):
See also (search result for "ObservableListWrapper.java:89"):
- https://bugs.openjdk.java.net/browse/JDK-8163078
- https://错误。 openjdk.java.net/browse/JDK-8096304
- JavaFX抛出ArrayIndexOutOfBoundsException
- JavaFX中的集合
- JavaFx - 线程中的无限异常JavaFX应用程序线程 java.lang.NullPointerException
- https://bugs.openjdk.java.net/browse/JDK-8163078
- https://bugs.openjdk.java.net/browse/JDK-8096304
- JavaFX throws ArrayIndexOutOfBoundsException
- Collection in JavaFX
- JavaFx - endless Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
这篇关于进度条更新崩溃javaFX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!