Forcing a Popup Menu to Be a Heavyweight Component : Popup menu « Swing JFC « Java






Forcing a Popup Menu to Be a Heavyweight Component

 

import javax.swing.JPopupMenu;

public class Main {
  public static void main(String[] argv) throws Exception {
    JPopupMenu popupMenu = new JPopupMenu();

    boolean lwPopup = popupMenu.isLightWeightPopupEnabled(); // true

    popupMenu.setLightWeightPopupEnabled(false);

  }
}

   
  








Related examples in the same category

1.Creating a Popup Menu
2.A popup menu is sometimes called a context menu
3.Force the popup menu of a JMenu to be heavyweight
4.Creating a Popup Menu with Nested Menus
5.JPopupMenu with mouse event
6.set Component Popup Menu
7.Configure all popup menus to be heavyweight
8.setInheritsPopupMenu