From: David ‘Bombe’ Roden Date: Thu, 4 Sep 2008 23:13:50 +0000 (+0200) Subject: Use a JSplitPane to divide the two panels of the file manager. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=inline;h=61fe749eaa69c139ba3fe6a9e28a00f3ceb83ada;p=jSite2.git Use a JSplitPane to divide the two panels of the file manager. --- diff --git a/src/net/pterodactylus/jsite/gui/FileManager.java b/src/net/pterodactylus/jsite/gui/FileManager.java index f84d5b7..98e9d80 100644 --- a/src/net/pterodactylus/jsite/gui/FileManager.java +++ b/src/net/pterodactylus/jsite/gui/FileManager.java @@ -59,9 +59,11 @@ import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JSeparator; +import javax.swing.JSplitPane; import javax.swing.JTextField; import javax.swing.JTree; import javax.swing.SwingConstants; +import javax.swing.border.EmptyBorder; import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; import javax.swing.event.TreeSelectionEvent; @@ -473,11 +475,13 @@ public class FileManager extends JDialog implements I18nable, TreeSelectionListe * @return The mail panel */ private Component createFileManagerPanel() { - JPanel fileManagerPanel = new JPanel(new BorderLayout(12, 12)); + JSplitPane fileManagerPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true); + fileManagerPanel.setBorder(null); /* file tree panel */ JPanel fileTreePanel = new JPanel(new BorderLayout(12, 12)); - fileManagerPanel.add(fileTreePanel, BorderLayout.LINE_START); + fileTreePanel.setBorder(new EmptyBorder(0, 0, 0, 12)); + fileManagerPanel.setLeftComponent(fileTreePanel); fileTree = new JTree(fileTreeModel); fileTree.setShowsRootHandles(false); @@ -494,7 +498,8 @@ public class FileManager extends JDialog implements I18nable, TreeSelectionListe /* the right panel */ JPanel rightPanel = new JPanel(new BorderLayout(12, 12)); - fileManagerPanel.add(rightPanel, BorderLayout.CENTER); + rightPanel.setBorder(new EmptyBorder(0, 12, 0, 0)); + fileManagerPanel.setRightComponent(rightPanel); /* properties panel */ JPanel propertiesPanel = new JPanel(new GridBagLayout());