I'm unable to get this one myself, but the trace can hopefully point us
to the problem.
I also find that the behavior of the Horizontal scrollbar leaves a lot
to be desired. Clicking in the empty area should shift it by a full
view width, but it only shifts by like 16 pixels orso.
So there are some bugs, but at least not quite as severe as I thought.
--John
On 12/07/2023 18:28, Andy Goryachev wrote:
... and just by randomly clicking on the scrollbar I got this:
Exception in thread "JavaFX Application Thread"
_java.lang.IndexOutOfBoundsException_: Index -1 out of bounds for length 2
at
java.base/jdk.internal.util.Preconditions.outOfBounds(_Preconditions.java:100_)
at
java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(_Preconditions.java:106_)
at
java.base/jdk.internal.util.Preconditions.checkIndex(_Preconditions.java:302_)
at java.base/java.util.Objects.checkIndex(_Objects.java:359_)
at java.base/java.util.ArrayList.get(_ArrayList.java:427_)
at
javafx.controls/javafx.scene.control.skin.VirtualFlow.updateCellSize(_VirtualFlow.java:3099_)
at
javafx.controls/javafx.scene.control.skin.VirtualFlow.positionCell(_VirtualFlow.java:1975_)
at
javafx.controls/javafx.scene.control.skin.VirtualFlow.scrollPixels(_VirtualFlow.java:1650_)
at
javafx.controls/javafx.scene.control.skin.VirtualFlow.tryScrollOneCell(_VirtualFlow.java:1565_)
at
javafx.controls/javafx.scene.control.skin.VirtualFlow.scrollTo(_VirtualFlow.java:1536_)
at
javafx.controls/com.sun.javafx.scene.control.VirtualScrollBar.adjustValue(_VirtualScrollBar.java:142_)
at
javafx.controls/com.sun.javafx.scene.control.behavior.ScrollBarBehavior.lambda$20(_ScrollBarBehavior.java:162_)
at
javafx.controls/com.sun.javafx.scene.control.behavior.ScrollBarBehavior.trackPress(_ScrollBarBehavior.java:173_)
at
javafx.controls/javafx.scene.control.skin.ScrollBarSkin.lambda$7(_ScrollBarSkin.java:411_)
at
javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(_CompositeEventHandler.java:86_)
at
javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(_EventHandlerManager.java:232_)
at
javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(_EventHandlerManager.java:189_)
at
javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(_CompositeEventDispatcher.java:59_)
at
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(_BasicEventDispatcher.java:58_)
at
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(_EventDispatchChainImpl.java:114_)
at
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(_BasicEventDispatcher.java:56_)
at
javafx.controls/javafx.scene.control.skin.VirtualFlow.lambda$2(_VirtualFlow.java:369_)
at
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(_EventDispatchChainImpl.java:114_)
at
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(_BasicEventDispatcher.java:56_)
at
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(_EventDispatchChainImpl.java:114_)
at
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(_BasicEventDispatcher.java:56_)
at
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(_EventDispatchChainImpl.java:114_)
at
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(_BasicEventDispatcher.java:56_)
at
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(_EventDispatchChainImpl.java:114_)
at
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(_BasicEventDispatcher.java:56_)
at
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(_EventDispatchChainImpl.java:114_)
at
javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(_EventUtil.java:74_)
at
javafx.base/com.sun.javafx.event.EventUtil.fireEvent(_EventUtil.java:54_)
at javafx.base/javafx.event.Event.fireEvent(_Event.java:198_)
at
javafx.graphics/javafx.scene.Scene$MouseHandler.process(_Scene.java:3984_)
at
javafx.graphics/javafx.scene.Scene.processMouseEvent(_Scene.java:1890_)
at
javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(_Scene.java:2708_)
at
javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(_GlassViewEventHandler.java:411_)
at
javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(_GlassViewEventHandler.java:1_)
at
java.base/java.security.AccessController.doPrivileged(_AccessController.java:399_)
at
javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$2(_GlassViewEventHandler.java:450_)
at
javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(_QuantumToolkit.java:424_)
at
javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(_GlassViewEventHandler.java:449_)
at
javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(_View.java:551_)
at
javafx.graphics/com.sun.glass.ui.View.notifyMouse(_View.java:937_)
at
javafx.graphics/com.sun.glass.ui.mac.MacView.notifyMouse(_MacView.java:127_)
-andy
*From: *John Hendrikx <john.hendr...@gmail.com>
*Date: *Wednesday, July 12, 2023 at 09:25
*To: *Ajit Ghaisas <ajit.ghai...@oracle.com>
*Cc: *openjfx-dev@openjdk.org <openjfx-dev@openjdk.org>, Andy
Goryachev <andy.goryac...@oracle.com>
*Subject: *[External] : Re: ListView with ImageViews for cells very
bugged?
Hi Ajit,
Thanks for checking, that is indeed a bit of a beginner mistake
there... sorry for that.
I added the line, and it is much improved (luckily), but I still see
issues 2 and 3.
I can narrow down 2 a bit. When there is only space to show a single
row (or less than a single line), the scrollbar won't respond to
clicks in the empty area. When at least a full row is visible, then
it starts working normally.
I wonder if it might be possible to warn if that line is missing
somehow, or provide a different method to override that doesn't
require calling super.
On 12/07/2023 11:26, Ajit Ghaisas wrote:
Hi John,
This looks like a user code issue and not a JavaFX bug.
Most of the vertical scrollbar issues that you have mentioned get
fixed by adding a call to "super.updateItem(image, empty);" as a
first call in the cell factory method "protected void
updateItem(Image image, boolean empty)”
I am seeing an exception when I scroll fully down and then scroll
up by clicking empty area on the vertical scrollbar. This looks
like a separate issue though.
I didn't see any exceptions, just that the scrollbar is unresponsive
when clicking in the empty area when less than a full row is visible.
--John