javafx rectangle set border code example Example: javafx rectangle border size rectangle.setStrokeWidth(width);