17-04-2012, 11:01 AM
Menu Element
java.docx (Size: 55.63 KB / Downloads: 32)
Introducing Swing Menus:-
Swing menu components are subclasses of JComponent. Consequently, they have all the benefits of a Swing component, and you can treat them as such with respect to layout managers and containers.
Here are some notable features of the Swing menu system:
• Icons can augment or replace menu items.
• Menu items can be radio buttons.
• Keyboard accelerators can be assigned to menu items; these appear next to the menu item text.
• Most standard Swing components can be used as menu items.
Packages that use MenuElement :-
javax.swing - Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
javax.swing.event - Provides for events fired by Swing components.
javax.swing.plaf.basic - Provides user interface objects built according to the Basic look and feel.
javax.swing.plaf.metal - Provides user interface objects built according to the Java look and feel (once codenamed Metal), which is the default look and feel.
Methods in javax.swing with parameters of type MenuElement :-
JMenuItem.processKeyEvent(KeyEvent e, MenuElement[] path, MenuSelectionManager manager)
Processes a key event forwarded from the MenuSelectionManager and changes the menu selection, if necessary, by using MenuSelectionManager's API.
JPopupMenu.processKeyEvent(KeyEvent e, MenuElement[] path, MenuSelectionManager manager)
Processes a key event forwarded from the MenuSelectionManager and changes the menu selection, if necessary, by using MenuSelectionManager's API.