Add exit menu button.
This commit is contained in:
@@ -2,6 +2,7 @@ package net.themusicinnoise.vaccalc;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.awt.event.*;
|
||||||
import java.time.YearMonth;
|
import java.time.YearMonth;
|
||||||
|
|
||||||
public class VacCalc extends JFrame {
|
public class VacCalc extends JFrame {
|
||||||
@@ -15,6 +16,18 @@ public class VacCalc extends JFrame {
|
|||||||
setResizable(false);
|
setResizable(false);
|
||||||
setLocationRelativeTo(null);
|
setLocationRelativeTo(null);
|
||||||
|
|
||||||
|
JMenuBar menuBar = new JMenuBar();
|
||||||
|
JMenu appMenu = new JMenu("VacCalc");
|
||||||
|
JMenuItem exitButton = new JMenuItem("Exit");
|
||||||
|
exitButton.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
appMenu.add(exitButton);
|
||||||
|
menuBar.add(appMenu);
|
||||||
|
setJMenuBar(menuBar);
|
||||||
|
|
||||||
calendarPanel = new CalendarPanel();
|
calendarPanel = new CalendarPanel();
|
||||||
|
|
||||||
JPanel headerPanel = createHeaderPanel();
|
JPanel headerPanel = createHeaderPanel();
|
||||||
|
|||||||
Reference in New Issue
Block a user