Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Transparent background in javafx StackPane

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody, I am trying to make my StackPane completely transparent with non transparent content. I have already tried to set a background color with rgb(255,255,255,0) to that pane, but it still having a white background and I can not find out why? I am using embed javafx to swing so I am setting a transparent scene to a JFXPanel like that:

the result:
If enybody knows how to solve this issue, can give me a hand with it? Thanks in advance)))
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really need to use embedded Swing?
If you can write a pure JavaFX application then you can achieve the desired effect, transparent panes with non-transparent children with no issue.

You may wish to supply a complete example (sscce), that replicates the issue.

You don't need to set the background or opaque properties of the JFXPanel, because, regardless JFXPanel isOpaque will always return false, so these two settings will be ignored.

I did some quick testing and drawing a JFXPanel over a Swing panel which has an opaque background works fine. Drawing it over a Swing panel which has a translucent background seems to double the underlying background color in the JFXPanel background (as you have in your image). I don't really have a solution to this. It may be a bug in the JFXPanel implementation, which you could log at

Here is the test program I used:

Water proof donuts! Eat them while reading this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic