1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
import java.awt.*;
public class MenuFrame extends Frame {
private MenuBar menuBar = new MenuBar();
private Menu ficMenu = new Menu("Fichier");
private Menu editMenu = new Menu("Edition");
private MenuItem quitItem = new MenuItem("Quitter");
private MenuItem colItem = new MenuItem("Coller");
public static void main(String[] args) {
MenuFrame menuFrame = new MenuFrame();
}
public MenuFrame(){
setSize(200,200);
ficMenu.add(quitItem);
editMenu.add(colItem);
menuBar.add(ficMenu);
menuBar.add(editMenu);
setMenuBar(menuBar);
show();
}
} |