gt:         final JPanel browserP = new JPanel(new BorderLayout());
context: 
  /***************************************************************************
   *   Copyright 2006-2014 by Christian Ihle                                 *
   *   contact@kouchat.net                                                   *
   *                                                                         *
   *   This file is part of KouChat.                                         *
   *                                                                         *
   *   KouChat is free software; you can redistribute it and/or modify       *
   *   it under the terms of the GNU Lesser General Public License as        *
   *   published by the Free Software Foundation, either version 3 of        *
   *   the License, or (at your option) any later version.                   *
   *                                                                         *
   *   KouChat is distributed in the hope that it will be useful,            *
   *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      *
   *   Lesser General Public License for more details.                       *
   *                                                                         *
   *   You should have received a copy of the GNU Lesser General Public      *
   *   License along with KouChat.                                           *
   *   If not, see <http://www.gnu.org/licenses/>.                           *
   ***************************************************************************/
  
  package net.usikkert.kouchat.ui.swing.settings;
  
  import java.awt.BorderLayout;
  import java.awt.Color;
  import java.awt.Desktop;
  import java.awt.FlowLayout;
  import java.awt.GridLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.awt.event.KeyEvent;
  import java.io.File;
  import java.io.IOException;
  import java.net.URISyntaxException;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  import javax.swing.AbstractAction;
  import javax.swing.Action;
  import javax.swing.BorderFactory;
  import javax.swing.Box;
  import javax.swing.BoxLayout;
  import javax.swing.DefaultComboBoxModel;
  import javax.swing.JButton;
  import javax.swing.JCheckBox;
  import javax.swing.JComboBox;
  import javax.swing.JComponent;
  import javax.swing.JDialog;
  import javax.swing.JFileChooser;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  import javax.swing.JTextField;
  import javax.swing.KeyStroke;
  import javax.swing.UIManager.LookAndFeelInfo;
  import javax.swing.WindowConstants;
  
  import edu.sydney.testing.TestingUtils;
  import net.usikkert.kouchat.Constants;
  import net.usikkert.kouchat.misc.ErrorHandler;
  import net.usikkert.kouchat.net.NetworkInterfaceInfo;
  import net.usikkert.kouchat.net.NetworkUtils;
  import net.usikkert.kouchat.settings.Settings;
  import net.usikkert.kouchat.ui.swing.CopyPastePopup;
  import net.usikkert.kouchat.ui.swing.ImageLoader;
  import net.usikkert.kouchat.ui.swing.LookAndFeelWrapper;
  import net.usikkert.kouchat.ui.swing.Mediator;
  import net.usikkert.kouchat.ui.swing.StatusIcons;
  import net.usikkert.kouchat.ui.swing.UITools;
  import net.usikkert.kouchat.ui.swing.messages.SwingMessages;
  import net.usikkert.kouchat.util.Validate;
  
  /**
   * This is the dialog window used to change settings.
   *
   * @author Christian Ihle
   */
  public class SettingsDialog extends JDialog implements ActionListener {
  
      private static final Logger LOG = Logger.getLogger(SettingsDialog.class.getName());
  
      private final NetworkUtils networkUtils = new NetworkUtils();
      private final UITools uiTools = new UITools();
  
      private final JButton saveB, cancelB, chooseOwnColorB, chooseSysColorB, testBrowserB, chooseBrowserB;
      private final JTextField nickTF, browserTF;
      private final JLabel ownColorL, sysColorL;
      private final JCheckBox soundCB, loggingCB, smileysCB, balloonCB;
      private final JComboBox lookAndFeelCB, networkInterfaceCB; // Java 6 doesn't support generic JComboBox
  
      private final Settings settings;
      private final ErrorHandler errorHandler;
      private final SwingMessages swingMessages;
  
      private Mediator mediator;
  
      /**
       * Constructor. Creates the dialog.
       *
       * @param imageLoader The image loader.
       * @param settings The settings to use.
       * @param errorHandler The handler to use for showing error messages.
       * @param swingMessages The swing messages to use for the dialog.
       */
      public SettingsDialog(final ImageLoader imageLoader, final Settings settings, final ErrorHandler errorHandler,
                            final SwingMessages swingMessages) {
          Validate.notNull(imageLoader, "Image loader can not be null");
          Validate.notNull(settings, "Settings can not be null");
          Validate.notNull(errorHandler, "Error handler can not be null");
          Validate.notNull(swingMessages, "Swing messages can not be null");
  
          this.settings = settings;
          this.errorHandler = errorHandler;
          this.swingMessages = swingMessages;
  
          final JLabel nickL = new JLabel(swingMessages.getMessage("swing.settings.chooseNick.nickName.label"));
          nickTF = new JTextField(10);
          new CopyPastePopup(nickTF, swingMessages);
  
          final JPanel nickP = new JPanel(new FlowLayout(FlowLayout.LEFT));
          nickP.add(nickL);
          nickP.add(nickTF);
          nickP.setBorder(BorderFactory.createTitledBorder(swingMessages.getMessage("swing.settings.chooseNick.border")));
  
          ownColorL = new JLabel(swingMessages.getMessage("swing.settings.chooseLook.ownTextColor.label"));
          ownColorL.setToolTipText(swingMessages.getMessage("swing.settings.chooseLook.ownTextColor.tooltip"));
  
          sysColorL = new JLabel(swingMessages.getMessage("swing.settings.chooseLook.systemTextColor.label"));
          sysColorL.setToolTipText(swingMessages.getMessage("swing.settings.chooseLook.systemTextColor.tooltip"));
  
          chooseOwnColorB = new JButton(swingMessages.getMessage("swing.button.change"));
          chooseOwnColorB.addActionListener(this);
          chooseSysColorB = new JButton(swingMessages.getMessage("swing.button.change"));
          chooseSysColorB.addActionListener(this);
  
          final JPanel ownColorP = new JPanel();
          ownColorP.setLayout(new BoxLayout(ownColorP, BoxLayout.LINE_AXIS));
          ownColorP.add(ownColorL);
          ownColorP.add(Box.createHorizontalGlue());
          ownColorP.add(chooseOwnColorB);
  
          final JPanel sysColorP = new JPanel();
          sysColorP.setLayout(new BoxLayout(sysColorP, BoxLayout.LINE_AXIS));
          sysColorP.add(sysColorL);
          sysColorP.add(Box.createHorizontalGlue());
          sysColorP.add(chooseSysColorB);
  
          final JLabel lookAndFeelL = new JLabel(swingMessages.getMessage("swing.settings.chooseLook.lookAndFeel.label"));
          lookAndFeelL.setToolTipText(swingMessages.getMessage("swing.settings.chooseLook.lookAndFeel.tooltip", Constants.APP_NAME));
          lookAndFeelCB = new JComboBox();
  
          final JPanel lookAndFeelP = new JPanel();
          lookAndFeelP.setLayout(new BoxLayout(lookAndFeelP, BoxLayout.LINE_AXIS));
          lookAndFeelP.add(lookAndFeelL);
          lookAndFeelP.add(Box.createHorizontalGlue());
          lookAndFeelP.add(lookAndFeelCB);
  
          final JPanel lookP = new JPanel(new GridLayout(3, 1, 1, 4));
          lookP.add(ownColorP);
          lookP.add(sysColorP);
          lookP.add(lookAndFeelP);
          lookP.setBorder(BorderFactory.createCompoundBorder(
                  BorderFactory.createTitledBorder(swingMessages.getMessage("swing.settings.chooseLook.border")),
                  BorderFactory.createEmptyBorder(0, 5, 0, 5)));
  
          soundCB = new JCheckBox(swingMessages.getMessage("swing.settings.misc.enableSound.label"));
          soundCB.setToolTipText(swingMessages.getMessage("swing.settings.misc.enableSound.tooltip", Constants.APP_NAME));
  
          loggingCB = new JCheckBox(swingMessages.getMessage("swing.settings.misc.enableLogging.label"));
          loggingCB.setToolTipText(swingMessages.getMessage("swing.settings.misc.enableLogging.tooltip", settings.getLogLocation()));
  
          smileysCB = new JCheckBox(swingMessages.getMessage("swing.settings.misc.enableSmileys.label"));
          smileysCB.setToolTipText(swingMessages.getMessage("swing.settings.misc.enableSmileys.tooltip"));
  
          balloonCB = new JCheckBox(swingMessages.getMessage("swing.settings.misc.enableBalloons.label"));
          balloonCB.setToolTipText(swingMessages.getMessage("swing.settings.misc.enableBalloons.tooltip"));
  
          final JPanel miscCheckBoxP = new JPanel(new GridLayout(2, 2));
          miscCheckBoxP.add(soundCB);
          miscCheckBoxP.add(loggingCB);
          miscCheckBoxP.add(smileysCB);
          miscCheckBoxP.add(balloonCB);
  
          final JLabel networkInterfaceL = new JLabel(swingMessages.getMessage("swing.settings.misc.networkInterface.label"));
          networkInterfaceL.setToolTipText(swingMessages.getMessage("swing.settings.misc.networkInterface.tooltip", Constants.APP_NAME));
          networkInterfaceCB = new JComboBox();
          networkInterfaceCB.setRenderer(new NetworkChoiceCellRenderer());
  
          final JPanel networkInterfaceP = new JPanel();
          networkInterfaceP.setLayout(new BoxLayout(networkInterfaceP, BoxLayout.LINE_AXIS));
          networkInterfaceP.add(networkInterfaceL);
          networkInterfaceP.add(Box.createHorizontalGlue());
          networkInterfaceP.add(networkInterfaceCB);
  
          final JPanel miscP = new JPanel(new BorderLayout(0, 0));
          miscP.add(miscCheckBoxP, BorderLayout.NORTH);
          miscP.add(networkInterfaceP, BorderLayout.SOUTH);
          miscP.setBorder(BorderFactory.createCompoundBorder(
                  BorderFactory.createTitledBorder(swingMessages.getMessage("swing.settings.misc.border")),
                  BorderFactory.createEmptyBorder(0, 5, 0, 5)));
  
          final JLabel browserL = new JLabel(swingMessages.getMessage("swing.settings.chooseBrowser.browser.label"));
          browserTF = new JTextField(22);
          browserTF.setToolTipText(swingMessages.getMessage("swing.settings.chooseBrowser.browser.tooltip"));
          new CopyPastePopup(browserTF, swingMessages);
  
          final JPanel browserTopP = new JPanel(new FlowLayout(FlowLayout.LEFT));
          browserTopP.add(browserL);
          browserTopP.add(browserTF);
  
          chooseBrowserB = new JButton(swingMessages.getMessage("swing.button.choose"));
          chooseBrowserB.addActionListener(this);
          testBrowserB = new JButton(swingMessages.getMessage("swing.button.test"));
          testBrowserB.addActionListener(this);
  
          final JPanel browserBottomP = new JPanel(new FlowLayout(FlowLayout.RIGHT));
          browserBottomP.add(chooseBrowserB);
          browserBottomP.add(testBrowserB);
  
  