Style a Popup in a Skin

Florian Brunner fbrunnerlist at
Fri Sep 8 19:24:02 UTC 2017


Sorry to bother this list with this question, but I didn' receive any answer on Stackoverflow and I'm not sure if or how this is supported at all:

In a Skin implementation of a custom control I want to style a Popup.

I guess I have to use the PopupControl[1], not Popup[2]. 
PopupControl popup = new PopupControl();
popup.setStyle("-fx-background-color: red;");
popup.getStyleClass().add("my-popup");, screenLocation.getX(), screenLocation.getY()); 
The skinnable overrides the userAgentStylesheet: 
public String getUserAgentStylesheet() {
    return Stylesheets.getDefaultStylesheet();
But neither the style, nor the styleClass nor any styleClass applied to any child node of popupContentPane has some effect. 
If I understand the documentation[3] correctly the popup should use the stylesheet of the ownerNode (here the skinnable). 
How can I style a popup in a skin? 
Or should I file an enhancement request?

Kind regards,Florian


More information about the openjfx-dev mailing list