package midgardexodus;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.io.*;public class Main implements ActionListener { JButton testbutton; JMenuItem help; /** Creates a new instance of Main */ public Main() { JFrame window = new JFrame("Midgard Exodus"); window.setSize(800, 600); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); testbutton = new JButton("Hi"); window.add(testbutton); testbutton.addActionListener(this); // Create the menu bar JMenuBar menuBar = new JMenuBar(); JMenu menu = new JMenu("File"); menuBar.add(menu); help = new JMenuItem("Help"); help.addActionListener(this); menu.add(help); window.setJMenuBar(menuBar); //make visible window.setVisible(true); } public void actionPerformed(ActionEvent actionEvent) { Object source = actionEvent.getSource(); if (source == testbutton) { System.out.println("WOOT"); } if (source == help) { JFrame helpwindow = new JFrame("Help"); helpwindow.setSize(120, 400); JTextBox help = new JTextField(40,40); try { BufferedReader in = new BufferedReader(new FileReader("helptext.txt")); String text; while ((text = in.readLine()) != null) { help.append(text); } } catch(IOException ex) { System.out.println("That is bad"); } helpwindow.setVisible(true); } else { System.out.println("That is bad"); } } public static void main(String[] args) { Main launcher = new Main(); }}