You are on page 1of 1

import javax.swing.*; import java.awt.event.*; import java.awt.

*; public class notepad extends Jframe implements ActionListener { JmenuBar mnu; Jmenu File,Edit,Format; JmenuItem New,Open,Save; ImageIcon op,sav; public notepad() { mnu=new JmenuBar(); Set JmenuBar(mnu); File=new Jmenu("File"); Edit=new Jmenu("Edit"); Format=new Jmenu("Format"); mnu.add(File); mnu.add(Edit); mnu.add(Format); New= new JmenuItem("New"); Open=new JmenuItem("Open"); Save=new JmenuItem("Save"); File.add(New); File.add(new JSeparator()); File.add(Open); File.add(new JSeparator()); File.add(Save); Open.add ActionListener(this); Save.add ActionListener(this); Content=new JTextArea(); add(Content); SetTitle("untitled-Notepad"); setVisible(true); setSize(400,400); } public static void main(String ar[]) { new Notepad(); } pub;ic void ActionPerformed(ActionEvent e) { }

} }