在JavaFX TextField中输入文本会冻结应用程序(Entering text into JavaFX TextField freezes application)
在我们的JavaFX应用程序中,不同的客户在TextField中输入文本时或多或少会偶尔出现以下错误。 因此,渲染框架似乎陷入了一个无限循环,在这个循环中,下面的错误被重复打印到系统控制台中。 从那里,应用程序完全冻结,必须被杀死并重新启动,这对于那些客户来说是一个完美的展示者。
线程问题(Fx和工作线程)不涉及这个地方。
该错误发生在Windows 7和10,Java 1.8.0_171中,但我记得它也出现在以前的Java版本中:
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.elementData(Unknown Source) at java.util.ArrayList.get(Unknown Source) 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.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.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.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.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$29(Toolkit.java:398) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:397) at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:424) at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:518) at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:498) at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:491) at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$403(QuantumToolkit.java:319) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177) at java.lang.Thread.run(Unknown Source)
对于我来说,这显然是Parent.java:1591中的一个编程错误,因为remainingDirtyNodes似乎不与dirtyNodes列表同步,但没有为dirtyNodes执行边界检查,导致ArrayIndexOutOfBoundsException。
有没有解决方法?
谢谢,彼得
PS:除此之外,JavaFX似乎运行得非常稳定,与它合作非常有趣。
in our JavaFX application different customers get more or less sporadically the following error while entering text in TextField's. As a result, the rendering framework seems to run into an endless loop in which the error below is repeatedly printed into the System console. From there, the application freezes completely, must be killed and restarted which is a complete showstopper for those customers.
Threading issues (Fx and worker threads) are not involved in this place.
The bug occurs in Windows 7 and 10, Java 1.8.0_171, but as I remember it occured also with previous Java versions:
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.elementData(Unknown Source) at java.util.ArrayList.get(Unknown Source) 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.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.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.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.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$29(Toolkit.java:398) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:397) at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:424) at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:518) at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:498) at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:491) at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$403(QuantumToolkit.java:319) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177) at java.lang.Thread.run(Unknown Source)
For me it's clearly an programming error in Parent.java:1591 since remainingDirtyNodes seems to be not in sync with dirtyNodes list but no bounds check is done for dirtyNodes, causing the ArrayIndexOutOfBoundsException.
Is there any workaround for this?
Thanks, Peter
PS: Apart from this, JavaFX seems to run impressively stable and it is fun to work with.
原文:https://stackoverflow.com/questions/50834039
最满意答案
您可以使用
myQuery.setMaxResults()
增加结果的数量。 尽管会有最大的最大值,所以你可以通过改变myQuery.setStartIndex()
来进行多个查询('分页'结果myQuery.setStartIndex()
。http://code.google.com/apis/gdata/javadoc/com/google/gdata/client/Query.html#setMaxResults (int) http://code.google.com/apis/gdata/javadoc/com/谷歌/ GDATA /客户端/ Query.html#setStartIndex(int)的
You can increase the number of results with
myQuery.setMaxResults()
. There will be a maximum maximum though, so you can make multiple queries ('paged' results) by varyingmyQuery.setStartIndex()
.http://code.google.com/apis/gdata/javadoc/com/google/gdata/client/Query.html#setMaxResults(int) http://code.google.com/apis/gdata/javadoc/com/google/gdata/client/Query.html#setStartIndex(int)
相关问答
更多-
删除日历条目(Delete calendar entries)[2021-11-17]
我用这个来删除: private void deleteEvent(ContentResolver resolver, Uri eventsUri, int calendarId) { Cursor cursor; if (android.os.Build.VERSION.SDK_INT <= 7) { //up-to Android 2.1 cursor = resolver.query(eventsUri, new String[]{ "_id" }, "Calenda ... -
最后我找到了答案。 我将发布谁感兴趣的链接。 https://groups.google.com/forum/#!topic/google-calendar-help-dataapi/YEnxdkQ2KhY Finally I found an answer. I'll publish the link for who is interested. https://groups.google.com/forum/#!topic/google-calendar-help-dataapi/YEnxdkQ2KhY ...
-
Google Calendar的EventQuery无法检索正确的条目(Google Calendar's EventQuery not retrieving correct entries)[2023-06-07]
发现问题: qry.StartDate = new DateTime(2011, 1, 1); qry.EndDate = new DateTime(2012, 1, 1); 应该: qry.StartTime = new DateTime(2011, 1, 1); qry.EndTime = new DateTime(2012, 1, 1); 这解决了我在问题中提到的两个问题。 (不确定为什么EventQuery类同时具有日期/时间属性,当只有一个集合工作时,这会让人感到困惑)。 Found ... -
使用EAV时,其中一个关键是使用“实体ID”进行连接,以便您选择的属性属于同一个实体。 SELECT a.boatuid FROM tx_gcnwnxmlparser_boats_specs a INNER JOIN tx_gcnwnxmlparser_boats_specs b ON a.boatuid = b.boatuid /* "Entity ID" join condition */ AND b.slug = 'ta ...
-
SortDirection.ASCENDING意味着首先获取最旧的实体(即具有最小值lastestEditDate )。 你想要的恰恰相反 - 最新的实体(即具有最大值 lastestEditDate )首先。 因此,请使用SortDirection.DESCENDING 。 The SortDirection.ASCENDING means to get the oldest entities (i.e the ones with the smallest values of lastestEditDat ...
-
如何使用服务帐户和.NET检索Google日历条目(How to retrieve Google calendar entries using service account and.NET)[2023-09-06]
我们的Calendar API团队检查了一个,他们发现了以下内容: 您尝试使用服务帐户628725648769-cda .... 3djjj@developer.gserviceaccount.com访问lbl.gov_7d ... 7oag@group.calendar.google.com的事件。 我对么? 看起来您在12日使用该服务帐户执行了成功的事件插入操作。 该帐户没有失败的请求到该日历。 但是,该服务帐户还在12日访问了lbl.gov_oe10h ..... un9c@group.calenda ... -
您可以使用myQuery.setMaxResults()增加结果的数量。 尽管会有最大的最大值,所以你可以通过改变myQuery.setStartIndex()来进行多个查询('分页'结果myQuery.setStartIndex() 。 http://code.google.com/apis/gdata/javadoc/com/google/gdata/client/Query.html#setMaxResults (int) http://code.google.com/apis/gdata/javad ...
-
获取最多两个条目查询(Get max of two entries query)[2021-06-25]
这将起作用,但您将无法按开始时间排序 select machinename, StatusCode, max(size) as size from machine where MachineID In( '33','22') and StatusCode = 166 group by machinename, StatusCode order by max(size) DESC This will work, but you won't be able to order by starttime sel ... -
Reverse以相反的顺序返回由元素组成的数组,它不会重新排列现有数组中的项。 只需修改为: let newArray = fetchArray.reverse() fetchArray = newArray return fetchArray! Reverse returns an array composed of the elements in reverse order, it does not re-arrange the items in the existing array. Just am ...
-
我缺少singleEvents参数,默认情况下为False 。 是否将重复事件扩展到实例中,并且仅返回单个一次性事件和重复事件的实例,而不是返回基础重复事件本身。 可选的。 默认值为False。 I was missing the singleEvents parameter, which is False by default. Whether to expand recurring events into instances and only return single one-off events a ...