Hi! Does somebody know how to get the total number of MenuItems in JPopupMenu? I'm searching for something like, popupmenu1.getNumberOfMenuItems(). I need it for the FOR statement

(for int i=0; i<popupmenu1.getNumberOfMenuItems(); i++) { ... }

Thanks!