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

[CSS] -fx-text-fill is not applied for MenuButton

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8, jfx17
    • javafx

      Run this sample code :

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.MenuButton;
      import javafx.scene.layout.HBox;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class MenuButtontest extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override public void start(Stage stage) throws Exception {
              Button button = new Button("Button");
              button.setStyle("-fx-text-fill:white;");

              MenuButton menuButton = new MenuButton("MenuButton");
              menuButton.setStyle("-fx-text-fill:white;");

              VBox vbox = new VBox(10, button, menuButton);
              Scene scene = new Scene(vbox, 200, 200);
              stage.setScene(scene);
              stage.show();
          }
      }

      You will see that the Label of the MenuButton is not white. If you use a simple "Button", the text will be white.

            Unassigned Unassigned
            shadzic Samir Hadzic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Imported: