how to scroll ListView to make a specific item visible (only when not visible already)

Tomas Mikula tomas.mikula at gmail.com
Fri Dec 13 14:34:54 PST 2013


On Wed, Sep 25, 2013 at 10:04 PM, Tomas Mikula <tomas.mikula at gmail.com> wrote:
> Hi,
>
> does anyone know of a way to make a specific ListView item visible,
> but don't scroll the ListView at all if the item is already in the
> viewport?

I will answer my question from months ago:

I have to dig up the VirtualFlow from ListView and the method
VirtualFlow.show(int index)
does exactly what I wanted.

Best,
Tomas

>
> I am working on a code editor, displaying lines in a ListView.
> Whenever the caret moves up/down, I want to bring the current line to
> the viewport.
>
> Thanks,
> Tomas
>
> P.S.: To determine if an item is visible, I tried tracking non-empty
> cells by listening to ListCell#emptyProperty(), but a non-empty cell
> is not necessarily visible.


More information about the openjfx-dev mailing list