How to get ScrollPane vertical positions?
See original GitHub issueI 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:
- Created a year ago
- Comments:10
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Jugen Yes, thank you. This is the way I went.
So maybe try either
(totalEstimatedHeight - viewPortHeight - 2)
orfractionalPos >= 0.9999
?