2

I've tried to do this with CSS like this (test example):

.context-menu {
    -fx-effect: dropshadow(one-pass-box, black, 10, 1.0, 3, 3)
}

but it doesn't work. Tried to find out which node i should style through ScenicView, but context menu disappearing before i can read info in SV. Can anyone help?

4lex1v
  • 21,367
  • 6
  • 52
  • 86
  • Hi, I currently have the same issue here. I found this discussion: http://stackoverflow.com/questions/11127999/how-do-you-set-the-style-for-a-javafx-contextmenu-using-css – Hendrik Ebbers Mar 02 '13 at 12:52

1 Answers1

0
yourMenu.setEffect(addLabelEffect());

Define the drop shadow in the classand check if its working. Here is a simple sample

private DropShadow addLabelEffect() {

        DropShadow ds = new DropShadow();
        ds.setSpread(0);
        ds.setOffsetY(1.0);
        ds.setOffsetX(1.0);
        ds.setColor(Color.BLACK);

        return ds;

    }
Ravindu
  • 2,408
  • 8
  • 30
  • 46