From b078eec37fb174bd4c76d82d27b0406124d09447 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 28 Jan 2009 00:03:43 +0100 Subject: [PATCH] Add menu bar. --- .../pterodactylus/jkeytool/gui/swing/SwingInterface.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java index 107dc8d..8a79747 100644 --- a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java +++ b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java @@ -30,6 +30,8 @@ import javax.swing.Action; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; import javax.swing.JPanel; import javax.swing.JTabbedPane; @@ -37,6 +39,7 @@ import net.pterodactylus.jkeytool.core.Core; import net.pterodactylus.jkeytool.gui.Interface; import net.pterodactylus.jkeytool.main.Main; import net.pterodactylus.util.i18n.gui.I18nAction; +import net.pterodactylus.util.i18n.gui.I18nMenu; import net.pterodactylus.util.swing.StatusBar; /** @@ -108,6 +111,7 @@ public class SwingInterface implements Interface { } private void createFrame() { + mainFrame.setJMenuBar(createMenubar()); mainFrame.getContentPane().add(createCenterPanel(), BorderLayout.CENTER); mainFrame.getContentPane().add(statusBar, BorderLayout.PAGE_END); mainFrame.pack(); @@ -122,6 +126,18 @@ public class SwingInterface implements Interface { return centerPanel; } + private JMenuBar createMenubar() { + JMenuBar menubar = new JMenuBar(); + + JMenu fileMenu = new I18nMenu("jkeytool.menu.file"); + menubar.add(fileMenu); + fileMenu.add(createKeyStoreAction); + fileMenu.addSeparator(); + fileMenu.add(quitAction); + + return menubar; + } + // // INTERFACE Interface // -- 2.7.4