I have a custom control which is 3 simple buttons. The control handles operations for the application to which it is tied, but it must reside on an external stage for reasons.
The thing that is annoying about it is that between all buttons is a white background.
I've tried all of the following to eliminate it:
- Init StageStyle to Transparent
- Declare Scene with a transparent background :
new Scene(Node, X, Y, Color.TRANSPARENT);
- Declare Scene with a NULL background :
new Scene(Node, X, Y, null);
- Have the control (which extends an HBox)
.setStyle("-fx-background-color : rgba(0, 0, 0, 0);");
All of these have failed to eliminate the appearance of the background. I've done this with Windows Forms, but is it possible to do with JavaFX?
You need to set the transparency of
This works for me:
That's the direct solution. Of course instead of setting the style directly it's better practice to use a stylesheet application.css:
Here's a screenshot with the application being over the code: