System.setProperty ("apple.laf.useScreenMenuBar", "true");
JFrame frame = new JFrame ("Menu Bar Demo");
JMenuBar bar = new JMenuBar();
JMenu fileMenu = new JMenu ("File");
JMenu editMenu = new JMenu ("Edit");
JMenu helpMenu = new JMenu ("Help");
bar.add (fileMenu);
bar.add (editMenu);
bar.add (helpMenu);
frame.setSize (300, 150);
frame.setJMenuBar (bar);
frame.setVisible (true);