--- a/src/main/java/de/uapcore/sudoku/MainMenu.java Mon Jul 27 12:52:34 2020 +0200 +++ b/src/main/java/de/uapcore/sudoku/MainMenu.java Mon Jul 27 13:12:40 2020 +0200 @@ -31,15 +31,13 @@ /** * Main menu bar. */ -public class MainMenu { +public class MainMenu extends JMenuBar { private final ActionHandler handler; - private final JMenuBar menuBar; - + public MainMenu(ActionHandler h) { handler = h; - menuBar = new JMenuBar(); - menuBar.add(createMenu("Datei", 'd', + add(createMenu("Datei", 'd', createMenuItem("Neu", 'n', "control N", ActionHandler.NEW), createMenuItem("Öffnen", 'f', "control O", ActionHandler.OPEN), createMenuItem("Speichern", 's', "control S", ActionHandler.SAVE), @@ -50,7 +48,7 @@ createSeparator(), createMenuItem("Beenden", 'e', ActionHandler.QUIT) )); - menuBar.add(createMenu("Info", 'i', + add(createMenu("Info", 'i', createMenuItem("Über...", 'b', "F1", ActionHandler.ABOUT) )); } @@ -90,8 +88,5 @@ return item; } - - public JMenuBar getMenuBar() { - return menuBar; - } + }