Javafx Menu – Text under icon

Issue

In my JavaFX project, I am trying to add an icon on Menu(mnAdmin) in the MenuBar using the CSS code below

#mnAdmin > .label {
          -fx-graphic: url("../images/Admin-icon32.png");
    }

and am getting the icon beside the text and I would like to get the text at the bottom of the icon.

What I am getting now
What would like to get

Is there any way to get it?

Solution

As suggested by kleopatra modified the code as stated below and it works well.

 #mnAdmin > .label {
              -fx-graphic: url("../images/Admin-icon32.png");
              -fx-content-display:top;
        }

Answered By – Renoj Joseph

Answer Checked By – Marilyn (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.