Today is so happy, and I want to share you this code. It demonstrates Frame using MenuBar and MenuItem. I think it is important to know about this little stuff.It will make you App looks great.Well, Here is some codes :
Declare Object for MenuBar, Me private MenuBar mnBar;
private Menu fmenu;
private Menu emenu;
private MenuItem newmnItem,openmnItem,savemnItem,closemnItem,copymnItem,pastemnItem,cutmnItem;
private CheckboxMenuItem showmnItem;
Constructor
mnBar=new MenuBar();
fmenu=new Menu("File");
mnBar.add(fmenu);
fmenu.add(newmnItem=new MenuItem("New..."));
fmenu.add(openmnItem=new MenuItem("Open..."));
fmenu.add(savemnItem=new MenuItem("Save..."));
fmenu.add(closemnItem=new MenuItem("Close..."));
emenu=new Menu("Edit");
emenu.add(copymnItem=new MenuItem("Copy"));
emenu.add(cutmnItem=new MenuItem("Cut"));
emenu.add(pastemnItem=new MenuItem("Paste"));
emenu.add(showmnItem=new CheckboxMenuItem("Show"));
showmnItem.setState(true);
mnBar.add(emenu);
And then you must set MenuBar for your Frame like this :myFrame.setMenuBar(mnBar);