0% found this document useful (0 votes)
2 views

199-33P - Programming Lab Java-Algorithm - Menu Bars and pull down menus

The document outlines a Java program to create a simple menu with a menu bar and pull-down menus. It provides a step-by-step algorithm for implementing the program, including creating a frame, adding menu items, and handling actions and window events. The final steps involve saving, compiling, and running the Java file named list9.java.

Uploaded by

Suraj Ladkat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

199-33P - Programming Lab Java-Algorithm - Menu Bars and pull down menus

The document outlines a Java program to create a simple menu with a menu bar and pull-down menus. It provides a step-by-step algorithm for implementing the program, including creating a frame, adding menu items, and handling actions and window events. The final steps involve saving, compiling, and running the Java file named list9.java.

Uploaded by

Suraj Ladkat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

9. Write a Java Program to create 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

You might also like