JPopupMenu: setLightWeightPopupEnabled(boolean aFlag) : JPopupMenu « javax.swing « Java by API






JPopupMenu: setLightWeightPopupEnabled(boolean aFlag)

 
import javax.swing.JMenu;
import javax.swing.JMenuItem;

public class Main {
  public static void main(String[] argv) throws Exception {
    JMenu menu = new JMenu("Menu Label");
    menu.add(new JMenuItem("Item Label"));

    boolean lwPopup = menu.getPopupMenu().isLightWeightPopupEnabled(); // true

    menu.getPopupMenu().setLightWeightPopupEnabled(false);
  }
}

   
  








Related examples in the same category

1.JPopupMenu: add(JMenuItem menuItem)
2.JPopupMenu: addPopupMenuListener(PopupMenuListener lis)
3.JPopupMenu: addSeparator()
4.JPopupMenu: setDefaultLightWeightPopupEnabled(boolean aFlag)
5.JPopupMenu: show(Component invoker, int x, int y)