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!

Transparency in png image not showing

colin-javaOct 8 2013 — edited Oct 9 2013

Hello,

I have a Region, which needs a background and an image 'on top' of it.

I can set the background using

setStyle("-fx-background-color: #" + 123456 + ";");

Or I can just use a Rectangle of that colour.

Then I have an ImageView...   spiralImgView = new ImageView(new Image("images/spiral2.png"));

The png image itself has some transparency in it.

So when I add them to the region...

this.getChildren().addAll(rect, spiralImgView);

I just get a white background showing behind the image.

Can anyone help me fix this?

Thanks

This post has been answered by KevinPas on Oct 8 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2013
Added on Oct 8 2013
6 comments
2,004 views