Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

fx-background-image and rounded borders

917979Jul 16 2012 — edited Jul 26 2012
Hi,

I am trying to use a simple image as background image for an HBox through repetition, but I have found a problem. The HBox has got rounded borders (using fx-background-radius) and when I set the background image with fx-background-image it does not fit the real borders of the HBox and it appears painted outside the limits.

The css code is the following:
-fx-background-radius: 0 0 30 30;
-fx-background-image:url('image1.png');
-fx-border-radius: 0 0 30 30;
-fx-border-width:0 2 2 2;
-fx-border-color:#D9D9D9 #D9D9D9 #D9D9D9 #D9D9D9;
-fx-effect: dropshadow( two-pass-box , rgba(0,0,0,0.35) , 20.13095238095238,0.5 , 0 , 18 ); 
Is this the expected behaviour? If a try it with background-color, it adjusts perfectly to the rounded borders. Should I set another property? (I have tried with fx-background-size and fx-background-repeat and fx-background-position but with no result)

Thanks in advance.

Regards.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2012
Added on Jul 16 2012
4 comments
1,872 views