question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get ScrollPane vertical positions?

See original GitHub issue

I have a TextArea and a ScrollPane:

private final StyleClassedTextArea textArea = new StyleClassedTextArea();
private final VirtualizedScrollPane scrollPane = new VirtualizedScrollPane(textArea);

And I need to know when my vertical bar is at the highest and the lowest positions. By other words when vertical scroll bar is on top or bottom. Something like this:

if (scrollPane.getVerticalBar().getPosition() == 0) { //0 -> top, 1 -> bottom
...
}

I’ve found several issues related to this problem but still have no solution. Could anyone say how to do it?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
PavelTurkishcommented, May 25, 2022

@Jugen Yes, thank you. This is the way I went.

0reactions
Jugencommented, May 25, 2022

So maybe try either (totalEstimatedHeight - viewPortHeight - 2) or fractionalPos >= 0.9999 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to adjust position of scroll in the scrollpane - Stack Overflow
Here's a utility class I use. It can be used to scroll to the top, bottom, left, right or horizonatal / vertical center...
Read more >
How to Use Scroll Panes - Oracle Help Center
If you have a mouse with a wheel (which is generally between the mouse buttons) use the mouse wheel to scroll the image...
Read more >
ScrollPane (JavaFX 14)
The current vertical scroll position of the ScrollPane. This value may be set by the application to scroll the view programatically. The ScrollPane...
Read more >
How to Use Scroll Panes - Computer Science, FSU
Compile and run the application. The main source file is ScrollDemo. · Move the knobs on the scroll bars. Watch the image scroll...
Read more >
Scroll Pane in JavaFX | Semantic portal — learn smart!
Use the setHbarPolicy and setVbarPolicy methods to specify the scroll bar policy for the horizontal and vertical scroll bars respectively. Thus, in Example...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found