Blurring 1px border

Konstantin Pasko paskokv at
Wed Aug 19 11:45:35 UTC 2015

Hi guys,

I've found a very strange thing about JavaFX and borders.

If an element has "*-fx-border-width: 1 1 1 1;*", then the border will be a
bit blur (not exactly 1px).
But if it's declared as "*-fx-border-width: 0 1 1 1;*", then the border is
perfectly sharp (exactly 1px).

I've attached java class and css, that shows this effect.

As a workaround I defined border as: *-fx-border-width: 0 1 1 1, 1 0 0 0;*
But if the border has rounded corners, this workaround (even with
border-insets) produces different rounded corners.

This is a big problem for us (at least for my UX-designer :) ), because it
doesn't look good. Especially when we style TextField, which should have
1px dark border, white background and shadow effect around it -- it looks
dirty with this blurring.

Do you have any ideas why it's happening?

Konstantin Pasko

More information about the openjfx-dev mailing list