List of usage examples for javax.swing MenuElement getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:Main.java
public static List<String> getParsedElements(MenuElement[] elements) { List<String> returnable = new ArrayList<String>(); for (MenuElement e : elements) { if (JMenuItem.class.isAssignableFrom(e.getClass())) { returnable.add(((JMenuItem) e).getText()); }//from w ww . j a v a2 s .c o m } return returnable; }