Here you can find the source of setEnabled(boolean enabled, JMenuItem... items)
public static void setEnabled(boolean enabled, JMenuItem... items)
//package com.java2s; //License from project: Open Source License import javax.swing.JMenuItem; public class Main { public static void setEnabled(boolean enabled, JMenuItem... items) { for (JMenuItem item : items) item.setEnabled(enabled);/* w ww . j a v a 2 s . c o m*/ } }