Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8265339

ColorPicker Dialog doesn't update its style after first display

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • jfx17
    • javafx
    • None

      The first time ColorPicker dialog is displayed all styles are correct in accordance with the Scene stylesheets. If however you change the stylesheets of the Scene afterwards and then display the dialog again it'll still show up with the initial style (before the change of stylesheets in the Scene).

      This is because the CustomColorDialog is created the first time the user presses the link to show it:

      customColorLink.setOnAction(new EventHandler<ActionEvent>() {
                  @Override public void handle(ActionEvent t) {
                      if (customColorDialog == null) {
                          customColorDialog = new CustomColorDialog(popupControl);

      And in the constructor of the CustomColorDialog all stylesheets are copied:

      if (ownerScene != null) {
                  if (ownerScene.getUserAgentStylesheet() != null) {
                customScene.setUserAgentStylesheet(ownerScene.getUserAgentStylesheet());
                  }
                  customScene.getStylesheets().addAll(ownerScene.getStylesheets());
              }

      This happens the first time the Dialog is shown. After that the stylesheets are never updated again. Meaning they are still the ones that existed the first time the Dialog was shown.

            Unassigned Unassigned
            pdvieira Pedro Vieira
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: