Is there any way of hiding the gray border of an ScrollPane control in JavaFX ?
4 Answers
44
votes
All controls in JavaFX can be modified using CSS styling. You may want to take a look at reference or tutorial.
Gray ScrollPane's border is actually the only part of the background which is visible behind the content. So you can change it by modifying the background:
ScrollPane sp = new ScrollPane();
sp.setStyle("-fx-background-color:transparent;");
4
votes
2
votes
Making the border transparent will leave a 1 pixel gap around the edge. IMHO, the correct answer is the one that Jens Piegsa linked to. https://stackoverflow.com/a/17540428/1725096