Basic HTML version of Foils prepared 19 July 97

Foil 30 New AWT component: PopupMenu

From Overview of JDK Version 1.1 Extensions CPS616 -- Information Track of CPS -- Spring Semester 97. by Nancy J. McCracken


1 PopupMenus are defined with similar methods as regular Menus - there are methods to add menuItems.
2 When you add the PopupMenu itself to a component, it doesn't appear in the component window.
3 In the MouseListener, in the processMouseEvent() method, you can respond to the user's mouse click in the component by calling the show() method of the PopupMenu to make it appear.
4 The items of the PopupMenu can cause events, and you would create event listeners for those events in the usual way.
5 Another new AWT feature is that regular Menus can have keyboard MenuShortcuts.

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998