Menu Font in Javafx

88 Views Asked by At

I have been trying to change the font of the menu, but no luck. I do not want the background to be white, but the font. This is my code: Can someone please help me?

// Add the menu items to the menu
        Menu menu = new Menu("Menu");
        menu.getItems().addAll(rulesItem, oddsItem, exitItem);
        menu.setStyle("-fx-font-size: 18; -fx-text-fill: white;");

I tried -fx-text-fill, but it doesn't work. I also tried setTextFill, but that doesn't work as well.

0

There are 0 best solutions below