5455565758596061626364
int height = (int) (displayMode.getHeight() * 0.80); int width = (int) (displayMode.getWidth() * 0.80); main.setSize(width, height); main.addWindowListener(new ExitListener(controller)); initMenuBar(); main.setJMenuBar(menubar);
7778798081828384858687
menubar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); JMenuItem exitItem = new JMenuItem("Exit"); exitItem.addActionListener(new ExitListener(controller)); fileMenu.add(exitItem); menubar.add(fileMenu);