Applet « Menu « Java Swing Q&A





1. menu applet    coderanch.com

2. hierarchical menu java applet    coderanch.com

4. Can you add a menu to an applet?    coderanch.com

import java.applet.Applet; import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; public class MenuApplet extends Applet implements MouseListener { private Label fileLabel; private PopupMenu fileMenu; public void init() { Panel menuBar = new Panel(); menuBar.setBackground( Color.lightGray ); menuBar.setLayout( new FlowLayout( FlowLayout.LEFT ) ); fileLabel = new Label( "File" ); fileLabel.addMouseListener( this ); fileMenu = new PopupMenu( "File" ); MenuItem exit = new MenuItem( "Exit" ...