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!

Inline style of -fx-background-image doesn't work in fxml

SageGuOct 21 2013 — edited Oct 25 2013

Hi,

I have encountered a problem about this topic.Background image couldn't be showed when using inline style.However, using external css file is just fine.

Could someone help me to figure it out? The file date.png is stored in the current package with the .fxml file which contains code snippets below.

I also found when I put a .fxml file into <fx:include ... />, its external css will lose. I haven't figured it out for serveral days.

Thank you for helping me.

<HBox prefHeight="26.0" prefWidth="1024.0" style="-fx-background-image:url('date.png');" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2">

</HBox>

This post has been answered by James_D on Oct 23 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2013
Added on Oct 21 2013
16 comments
5,872 views