import java.awt.Frame;
import java.awt.Menu;
import java.awt.*;
import java.awt.event.*;
public class Menucreation extends Frame implements WindowListener{
Menucreation()
{
MenuBar mb;
Menu f,e,w;
MenuItem n,c,cpy,pst,h;
mb= new MenuBar();
f=new Menu("file");
e=new Menu("edit");
w=new Menu("window");
n=new MenuItem("new");
c=new MenuItem("cut");
cpy=new MenuItem("copy");
pst=new MenuItem("paste");
h=new MenuItem("help");
this.setMenuBar(mb);
mb.add(f);
mb.add(e);
mb.add(w);
f.add(n);
e.add(c);
e.add(cpy);
e.add(pst);
w.add(h);
this.setVisible(true);
this.setSize(1000, 600);
this.setTitle("mine");
this.addWindowListener(this);
}
public static void main(String[] args) {
new Menucreation();
}
public void windowActivated(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowClosed(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowClosing(WindowEvent arg0) {
// TODO Auto-generated method stub
System.exit(0);
}
public void windowDeactivated(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowDeiconified(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowIconified(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowOpened(WindowEvent arg0) {
// TODO Auto-generated method stub
}
}
import java.awt.Menu;
import java.awt.*;
import java.awt.event.*;
public class Menucreation extends Frame implements WindowListener{
Menucreation()
{
MenuBar mb;
Menu f,e,w;
MenuItem n,c,cpy,pst,h;
mb= new MenuBar();
f=new Menu("file");
e=new Menu("edit");
w=new Menu("window");
n=new MenuItem("new");
c=new MenuItem("cut");
cpy=new MenuItem("copy");
pst=new MenuItem("paste");
h=new MenuItem("help");
this.setMenuBar(mb);
mb.add(f);
mb.add(e);
mb.add(w);
f.add(n);
e.add(c);
e.add(cpy);
e.add(pst);
w.add(h);
this.setVisible(true);
this.setSize(1000, 600);
this.setTitle("mine");
this.addWindowListener(this);
}
public static void main(String[] args) {
new Menucreation();
}
public void windowActivated(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowClosed(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowClosing(WindowEvent arg0) {
// TODO Auto-generated method stub
System.exit(0);
}
public void windowDeactivated(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowDeiconified(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowIconified(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowOpened(WindowEvent arg0) {
// TODO Auto-generated method stub
}
}
output:
No comments:
Post a Comment
SAY HELLO!!