How to make Textarea's permanent scrollbar vertical?

Many times I tried to make the vertical Scroll Bar of Textrea always active, and not visible only when focusing on Textarea , but I could not do it! ..

any help please

+5
source share
2 answers

I know that a lot of time has passed since this question was asked, but I still want to give an answer to those who need it. To make the ScrollBar visible, you just need to access it from the TextArea class when passing through the Scrollpane:

 .text-area > .scroll-pane{ -fx-vbar-policy:always; /* Control the vertical ScrollBar (always,needed,never) */ -fx-hbar-policy:always; /* Control the horizontal ScrollBar (always,needed,never) */ } 

Good luck

+2
source

If you indicated that in the code you can use the search:

 for (Node node : textArea.lookupAll(".scroll-pane")) { if (node instanceof ScrollPane) { ((ScrollPane) node).setVbarPolicy(ScrollBarPolicy.ALWAYS); } } } 
0
source

Source: https://habr.com/ru/post/1208677/


All Articles