You need a JMenuItem to prompt the window.
JMenu rules = new JMenu("Rules");
JMenuItem jmiRules = new JMenuItem("Rules");
rules.add(jmiRules);
menuBar.add(rules);
jmiRules.addActionListener( new rulesAction() );
Also put the displayRules.setVisible(true);
at the end of the actionPerformed
so everything is added before displayed
Also put the window.setVisible(true);
at the end of the main
. It's causing a delay of the menuBar. You should add all you components before making screen visible.