Example usage for javax.swing MenuElement getClass

List of usage examples for javax.swing MenuElement getClass

Introduction

In this page you can find the example usage for javax.swing MenuElement getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

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;
}