In my figure I have a ScrollPane and want to scroll text there vertically, but I am only able to scroll horizontally. What am I doing wrong?
String text = "Some long text with...";
ScrollPane scrollpane = new ScrollPane();
Viewport viewport= new Viewport();
flowPage = new FlowPage();
textFlow = new TextFlow();
Hi Alex. I tried your code in my editor and it does display vertical scroll bars, only you have to re-size your figure until it is smaller than the height of the text. Try the same code with a number of newlines ("\n") in the middle and the scroll bar will probably show.
I had a different problem in my code: the scroll bars did not get my mouse clicks. I am sure there is no figure on top of them or things like that.
Any ideas anyone?
Thanks vainolo, but I wonder how does it calculate that text is scrolled horizontally and not vertically? Could it be nature of TextFlow? I didn't find any properties that would set preference of the scroll bars.