199-33P - Programming Lab Java-Algorithm - Menu Bars and pull down menus
199-33P - Programming Lab Java-Algorithm - Menu Bars and pull down menus
Algorithm:
Aim: Creating a Simple Menu with Menu Bar and Pull down Menu
Step No. Instructions
1 Start
2 Create an Frame called “list9” by
a) Inheriting the Frame class
b) Implementing the ActionListener and WindowListener Interface
3 Create 3 Menu Objects as FILE, EDIT and SEARCH using Menu Class
4 Add the menu items NEW, OPEN, SAVE, SAVE AS and EXIT using MenuItem( )
function under FILE object
5 Add the menu items CUT, COPY and PASTE using MenuItem( ) function under
EDIT object
6 Add the menu items FIND and REPLACE using MenuItem( ) function under
SEARCH object
7 Create a Menu Bar and add the Menu Objects on it
8 Use addActionListener( ) AND addWindowListener ( ) function for both objects
9 Catch the ActionEvent and use getSource( )
10 Catch the Window Events for windowDeiconified( ), windowIconified( ),
windowOpened( ), windowActivated( ) and windowDeactivated( )
11 Save the Frame in the name of list9.java
12 Compile the Frame using javac
13 Run the Frame using java
14 Stop