use panel instead of box for add project button
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 1 Jun 2008 10:42:00 +0000 (12:42 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 1 Jun 2008 10:42:00 +0000 (12:42 +0200)
src/net/pterodactylus/jsite/gui/MainWindow.java

index d4924d0..2a50313 100644 (file)
@@ -23,6 +23,9 @@ import java.awt.BorderLayout;
 import java.awt.Component;
 import java.awt.Container;
 import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.awt.event.WindowListener;
@@ -35,7 +38,6 @@ import java.util.TimerTask;
 import java.util.logging.Logger;
 
 import javax.swing.Box;
-import javax.swing.BoxLayout;
 import javax.swing.Icon;
 import javax.swing.JButton;
 import javax.swing.JFrame;
@@ -114,7 +116,7 @@ public class MainWindow extends JFrame implements WindowListener, I18nable, Prop
        private JTabbedPane projectPane;
 
        /** The project overview panel. */
-       private Box projectOverviewPanel;
+       private JPanel projectOverviewPanel;
 
        /** Maps from node to menus. */
        private final Map<Node, JMenu> nodeMenus = new HashMap<Node, JMenu>();
@@ -466,15 +468,12 @@ public class MainWindow extends JFrame implements WindowListener, I18nable, Prop
                projectPane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
                contentPane.add(projectPane, BorderLayout.CENTER);
 
-               projectOverviewPanel = new Box(BoxLayout.PAGE_AXIS);
+               projectOverviewPanel = new JPanel(new GridBagLayout());
                projectOverviewPanel.setName(I18n.get("mainWindow.pane.overview.title"));
                projectPane.add(projectOverviewPanel);
                projectOverviewPanel.setBorder(new EmptyBorder(12, 12, 12, 12));
-               projectOverviewPanel.add(Box.createVerticalGlue());
                JButton addProjectButton = new JButton(swingInterface.getAddProjectAction());
-               addProjectButton.setAlignmentX(0.5f);
-               projectOverviewPanel.add(addProjectButton);
-               projectOverviewPanel.add(Box.createVerticalGlue());
+               projectOverviewPanel.add(addProjectButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        }
 
        //