Embedding a Simple Menu on a Applet and and on a Visual Application using JMenu
Two programs are created here which use menus, an Applet and a Visual Application. Both programs use JMenus. The Simple Menu Applet adds the JMenu's to a JMenuBar, then adds the JMenuBar to a Panel, and then places the Panel in the Applet. Click here to download the source for the Applet or here to view the source or here to run the Simple Visual Applet. The application adds the MenuBar directly to the visual application and uses a JLabel to show the result. Click here to obtain the source Simple Application Menu Program or here to view the source. The application uses a single action listening method. Notice the applet does not have an exit menu item as an exit function cannot be programmed in applet to exit.
Two programs are created here which use menus, an Applet and a Visual Application. Both programs use JMenus. The Simple Menu Applet adds the JMenu's to a JMenuBar, then adds the JMenuBar to a Panel, and then places the Panel in the Applet. Click here to download the source for the Applet or here to view the source or here to run the Simple Visual Applet. The application adds the MenuBar directly to the visual application and uses a JLabel to show the result. Click here to obtain the source Simple Application Menu Program or here to view the source. The application uses a single action listening method. Notice the applet does not have an exit menu item as an exit function cannot be programmed in applet to exit.