# HG changeset patch # User Dirk Olmes # Date 1315877351 -7200 # Node ID 1298f5b16ecfa00a23d44417bb41815be5f67b1b # Parent a5ef4fbfd90c792481228fcc2db37554194f0a5a switch to GridBagLayout diff -r a5ef4fbfd90c -r 1298f5b16ecf conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java --- a/conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java Tue Sep 13 02:33:01 2011 +0200 +++ b/conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java Tue Sep 13 03:29:11 2011 +0200 @@ -1,8 +1,9 @@ package de.codedo.conflicteditor.gui; -import java.awt.BorderLayout; import java.awt.FlowLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; import java.awt.HeadlessException; import javax.swing.JButton; @@ -27,7 +28,7 @@ { super(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setLayout(new BorderLayout()); + setLayout(new GridBagLayout()); buildGui(); } @@ -44,12 +45,20 @@ _findConflictsButton = new JButton("Find Conflicts"); JPanel databaseUrlPanel = new JPanel(); - databaseUrlPanel.setLayout(new FlowLayout()); + FlowLayout layout = new FlowLayout(FlowLayout.LEFT); + databaseUrlPanel.setLayout(layout); databaseUrlPanel.add(label); databaseUrlPanel.add(_databaseUrlTextField); databaseUrlPanel.add(_findConflictsButton); - getContentPane().add(databaseUrlPanel, BorderLayout.NORTH); + GridBagConstraints constraints = new GridBagConstraints(); + constraints.gridx = 0; + constraints.gridy = 0; + constraints.weightx = 0.5; + constraints.weighty = 0.1; + constraints.anchor = GridBagConstraints.LINE_START; + constraints.fill = GridBagConstraints.HORIZONTAL; + getContentPane().add(databaseUrlPanel, constraints); } private void buildConflictsListAndDifferencesTable() @@ -63,7 +72,14 @@ JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitPane.add(conflictsScrollPane); splitPane.add(differencesScrollPane); - getContentPane().add(splitPane, BorderLayout.CENTER); + + GridBagConstraints constraints = new GridBagConstraints(); + constraints.gridx = 0; + constraints.gridy = 1; + constraints.weightx = 0.5; + constraints.weighty = 0.9; + constraints.fill = GridBagConstraints.BOTH; + getContentPane().add(splitPane, constraints); } private void buildConflictsList()