From: David ‘Bombe’ Roden Date: Tue, 27 Jan 2009 23:01:30 +0000 (+0100) Subject: Add tabbed panel for key stores. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0024383ab6e99742fdf45ff5390ef144c3bfc4b1;p=jkeytool.git Add tabbed panel for key stores. --- diff --git a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java index 3190c2a..6a6597e 100644 --- a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java +++ b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java @@ -19,12 +19,17 @@ package net.pterodactylus.jkeytool.gui.swing; +import java.awt.BorderLayout; import java.io.File; import java.security.KeyStore; import java.util.HashMap; import java.util.Map; +import javax.swing.BorderFactory; +import javax.swing.JComponent; import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; import net.pterodactylus.jkeytool.core.Core; import net.pterodactylus.jkeytool.gui.Interface; @@ -44,6 +49,9 @@ public class SwingInterface implements Interface { /** The main frame. */ private JFrame mainFrame = new JFrame("jkeytool " + Main.getVersion()); + /** The tab pane. */ + private JTabbedPane tabPane = new JTabbedPane(); + /** The status bar. */ private StatusBar statusBar = new StatusBar(); @@ -59,10 +67,20 @@ public class SwingInterface implements Interface { // private void createFrame() { + mainFrame.getContentPane().add(createCenterPanel(), BorderLayout.CENTER); mainFrame.getContentPane().add(statusBar, BorderLayout.PAGE_END); mainFrame.pack(); } + private JComponent createCenterPanel() { + JPanel centerPanel = new JPanel(new BorderLayout()); + centerPanel.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6)); + + centerPanel.add(tabPane, BorderLayout.CENTER); + + return centerPanel; + } + // // INTERFACE Interface // @@ -110,6 +128,7 @@ public class SwingInterface implements Interface { public void keyStoreLoaded(File keyStoreFile, KeyStore keyStore) { KeyStorePanel keyStorePanel = new KeyStorePanel(keyStore); keyStores.put(keyStore, keyStorePanel); + tabPane.addTab(keyStoreFile.getName(), keyStorePanel); } /**