Convenience factories for Border and Background

Nir Lisker nlisker at gmail.com
Thu Apr 22 13:45:29 UTC 2021


Hi,

Many times when I want to create a simple solid Background or Border, it is
quite a hassle because of the configurability these classes have:

new Border(new BorderStroke(Color. BLACK, BorderStrokeStyle.SOLID, null,
null));
new Background(new BackgroundFill(Color.BLACK, null, null));

I was thinking of adding convenience factory methods

Border.of(Paint stroke), or Border.stroke(Paint stroke)
Background.of((Paint fill), or Background.fill(Paint fill)

I was wondering if others would like this, or is everyone using CSS anyway?

- Nir


More information about the openjfx-dev mailing list