Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+19 votes

I know that there is padding and margining feature to make my scene builder features to look prettier. But I was wondering how to make lines around features(e.g. buttons, gridpane, canvas, etc.) to separate from others and to make is look better.

asked in CSC305 Fall 2022 by (1 point)

2 Answers

+10 votes

Maybe look at css border style properties.:

E.g. http://www.java2s.com/Code/Java/JavaFX/UsingCSStostyletheborder.htm

answered by (508 points)
+7 votes

You can add "-fx-border-color", "-fx-border-style" and "-fx-border-width" in the style section (under Properties) of your javafx nodes. W3Schools also has some good resources for CSS styling, so maybe check out https://www.w3schools.com/css/css_border.asp

answered by (1 point)