I have a program that prints out loads of text to the text area which i used as a console in my app.
It outputs live building information.
By default it scrolls down to the bottom which is nice, but i would like to be able to grab the scrolling bar and go up in text area to check what is going on while the text is still appending to the text area.
My question is how i can disable auto-scrolling when i grab the scrolling bar ?
The ideal scenario would be : Auto-scroll if the scrolling bar is way back to the end Disable auto-scrolling when i took the scrolling bar up as its difficult to read anything while the text jump back to the end all the time.
This is my text area appender
private void run(final TextArea console) {
try {
console.clear();
BufferedReader stdInput;
stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = stdInput.readLine()) != null) {
String feed = line;
Platform.runLater(() -> console.appendText(feed + "\n"));
}
} catch (Exception e) {
console.appendText(e.toString());
}
}