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 {
+
MainWindowsView(String title) {
//Create and set up the window.
setTitle(title);
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();
//Get all Swing/AWT primitive components in the views and add them to the panel.
//this.pack();
this.setVisible(true);
}
-
-}
+}
\ No newline at end of file