Search code examples
javacssjavafxmenubarscenebuilder

Edit MenuBar with Css in JavaFx


Thanks for reading. I have trying to edit a menu-bar with css but the menu item don't changed.

I realized the parts of menu-bar are: Menubar, menu, menu-items but the last one don't work rightly. Help

.menu-bar{
  -fx-background-color: peru;
  -fx-border-color:  #f0cd90;
 -fx-border-width: 2

}

.menu-bar .label {
    -fx-font-size: 25 pt;
    -fx-font-family: "Segoe UI Light";
    -fx-text-fill: #dedede;

}


.menu:hover {
    -fx-background-color: #bc784e;
}

.menu-item .label{
     -fx-font-size: 25 pt;
    -fx-label-line-length: 8;
      -fx-background-color: #cc66ff;
}

I'm using Scene builder.


Solution

  • Make:

    .menu .label{     -fx-text-fill: black;}
    

    Reference: https://forums.oracle.com/message/10402062