ah im in 1st year IT student, my project is about to make a Notepad and it should have an event to perform.
example:
is when i go to [B]"file"[/B] then click the [B]"save"[/B] and it will perform.. pls give some example of class that use an event..
Im new member here so this is my greetings to all...
TIA...
by the way this is my code.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Notepad extends JFrame
{
JMenuBar mb=new JMenuBar();
JMenu menu=new JMenu("File");
JMenu m2=new JMenu("Edit");
JMenu m3=new JMenu("View");
JMenuItem i3=new JMenuItem("Save");
JMenuItem i1=new JMenuItem("New");
JMenuItem i2=new JMenuItem("Open");
JMenuItem o1=new JMenuItem("Cut");
JMenuItem o3=new JMenuItem("Paste");
JMenuItem o2=new JMenuItem("Copy");
JMenuItem o4=new JMenuItem("Delete");
JMenuItem p2=new JMenuItem("Status Bar");
JMenuItem p1=new JMenuItem("Details");
JTextArea txt=new JTextArea(50,50);
JScrollPane scroll=new JScrollPane(txt);
BorderLayout border=new BorderLayout();
Container con;
public Notepad()
{
con=getContentPane();
con.setLayout(border);
con.add(scroll);
menu.add(i1); menu.add(i2); menu.add(i3);
m2.add(o1);
m2.add(o2);
m2.add(o3);
m2.add(o4);
mb.add(menu);
mb.add(m2);
mb.add(m3);
m3.add(p1);
m3.add(p2);
con.add(mb,"North");
con.add(txt);
}
public static void main(String [] a)
{
Notepad pn=new Notepad();
pn.setSize(500,500);
pn.setTitle("NotePad");
pn.setVisible(true);
}
//here is my problem thanks a lot..
public void actionPerform(ActionEvent e)
{
}
}