java - Prevent hiding of contextmenu after selecting CheckMenuItem -


i have contextmenu on textfield (opens on focus) 2 checkmenuitems. selecting 1 menuitem leads hide contextmenu. how can prevent contextmenu hiding after selecting item (to allow more selections)

exampleapp:

public class contextmenutest extends application {    @override   public void start(stage primarystage) {       contextmenu contextmenu = new contextmenu();     checkmenuitem item1 = new checkmenuitem("test1");     checkmenuitem item2 = new checkmenuitem("test2");      contextmenu.getitems().addall(item1, item2);      textfield textfield = new textfield();     textfield textfield1 = new textfield();     textfield.focusedproperty().addlistener((object, oldval, newval) -> {       if(newval)         contextmenu.show(textfield, side.top, 0, 0);     });      vbox root = new vbox();     root.getchildren().addall(textfield, textfield1);      scene scene = new scene(root, 300, 250);      primarystage.setscene(scene);     primarystage.show();   }    public static void main(string[] args) {     launch(args);   } } 

thanks ideas.

edit: tried setautohide(false) not help


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -