Configure all popup menus to be heavyweight : Popup menu « Swing JFC « Java






Configure all popup menus to be heavyweight

 

import javax.swing.JPopupMenu;

public class Main {
  public static void main(String[] argv) throws Exception {
    boolean lwPopup = JPopupMenu.getDefaultLightWeightPopupEnabled(); // true

    // Globally use heavyweight components for all popup menus
    JPopupMenu.setDefaultLightWeightPopupEnabled(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.Forcing a Popup Menu to Be a Heavyweight Component
8.setInheritsPopupMenu