import javax.swing.*;
import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.util.ArrayList;
public class MainWindowsView extends JFrame {
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ //Create menu
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+ JMenu fileMenu = new JMenu("File");
+ menuBar.add(fileMenu);
+ JMenuItem exit = new JMenuItem("Exit");
+ exit.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ System.exit(0);
+ }
+ });
+ fileMenu.add(exit);
+
//Main pane
JPanel panel = new PersonView();
this.setVisible(true);
}
-}
+}
\ No newline at end of file