Example usage for javax.swing JOptionPane INFORMATION_MESSAGE

List of usage examples for javax.swing JOptionPane INFORMATION_MESSAGE

Introduction

In this page you can find the example usage for javax.swing JOptionPane INFORMATION_MESSAGE.

Prototype

int INFORMATION_MESSAGE

To view the source code for javax.swing JOptionPane INFORMATION_MESSAGE.

Click Source Link

Document

Used for information messages.

Usage

From source file:org.pgptool.gui.ui.decrypttext.DecryptTextPm.java

private String pasteFromCLipboard() {
    String clipboard = ClipboardUtil.tryGetClipboardText();
    if (clipboard == null || !StringUtils.hasText(clipboard)) {
        UiUtils.messageBox(findRegisteredWindowIfAny(), text("warning.noTextInClipboard"),
                text("term.attention"), JOptionPane.INFORMATION_MESSAGE);
        return null;
    }// w  w  w  .  j  a v  a2 s .com
    sourceText.setValueByOwner(clipboard);
    return clipboard;
}

From source file:net.sf.jabref.importer.fetcher.ACMPortalFetcher.java

@Override
public boolean processQueryGetPreview(String query, FetcherPreviewDialog preview, OutputPrinter status) {
    this.terms = query;
    piv = 0;/* w  w  w  .  j a v a 2  s  .co m*/
    shouldContinue = true;
    acmOrGuide = acmButton.isSelected();
    fetchAbstract = absCheckBox.isSelected();
    String address = makeUrl();
    LinkedHashMap<String, JLabel> previews = new LinkedHashMap<>();

    try {
        URLDownload dl = new URLDownload(address);

        String page = dl.downloadToString(Globals.prefs.getDefaultEncoding());

        int hits = getNumberOfHits(page, RESULTS_FOUND_PATTERN, ACMPortalFetcher.HITS_PATTERN);

        int index = page.indexOf(RESULTS_FOUND_PATTERN);
        if (index >= 0) {
            page = page.substring(index + RESULTS_FOUND_PATTERN.length());
        }

        if (hits == 0) {
            status.showMessage(Localization.lang("No entries found for the search string '%0'", terms),
                    Localization.lang("Search %0", getTitle()), JOptionPane.INFORMATION_MESSAGE);
            return false;
        } else if (hits > 20) {
            status.showMessage(
                    Localization.lang("%0 entries found. To reduce server load, only %1 will be downloaded.",
                            String.valueOf(hits), String.valueOf(PER_PAGE)),
                    Localization.lang("Search %0", getTitle()), JOptionPane.INFORMATION_MESSAGE);
        }

        hits = getNumberOfHits(page, PAGE_RANGE_PATTERN, ACMPortalFetcher.MAX_HITS_PATTERN);
        parse(page, Math.min(hits, PER_PAGE), previews);
        for (Map.Entry<String, JLabel> entry : previews.entrySet()) {
            preview.addEntry(entry.getKey(), entry.getValue());
        }

        return true;

    } catch (MalformedURLException e) {
        LOGGER.warn("Problem with ACM fetcher URL", e);
    } catch (ConnectException e) {
        status.showMessage(Localization.lang("Could not connect to %0", getTitle()),
                Localization.lang("Search %0", getTitle()), JOptionPane.ERROR_MESSAGE);
        LOGGER.warn("Problem with ACM connection", e);
    } catch (IOException e) {
        status.showMessage(e.getMessage(), Localization.lang("Search %0", getTitle()),
                JOptionPane.ERROR_MESSAGE);
        LOGGER.warn("Problem with ACM Portal", e);
    }
    return false;

}

From source file:com.simplexrepaginator.RepaginateFrame.java

protected JButton createRepaginateButton() {
    JButton b = new JButton("<html><center>Click to<br>repaginate", REPAGINATE_ICON);

    b.setHorizontalTextPosition(SwingConstants.LEFT);
    b.setIconTextGap(25);//from   w w  w .ja  v a  2 s.  c o  m

    b.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            try {
                int[] documentsPages = repaginator.repaginate();
                JOptionPane.showMessageDialog(RepaginateFrame.this,
                        "Repaginated " + documentsPages[0] + " documents with " + documentsPages[1] + " pages.",
                        "Repagination Complete", JOptionPane.INFORMATION_MESSAGE);
            } catch (Exception ex) {
                ex.printStackTrace();
                JOptionPane.showMessageDialog(RepaginateFrame.this, ex.toString(), "Error During Repagination",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    });

    return b;
}

From source file:eu.cassandra.training.utils.APIUtilities.java

/**
 * This function is used to send the user's credentials to the Cassandra
 * Server.//ww w .  j  a  va 2 s  .c om
 * 
 * @param username
 *          The username of the user in the server.
 * @param password
 *          The password of the user in the server.
 * @return true if connected, else false.
 * @throws Exception
 */
public static boolean sendUserCredentials(String username, char[] password) throws Exception {

    String pass = String.valueOf(password);

    try {
        UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(username,
                pass);

        char SEP = File.separatorChar;
        File dir = new File(System.getProperty("java.home") + SEP + "lib" + SEP + "security");
        File file = new File(dir, "jssecacerts");
        if (file.isFile() == false) {
            InstallCert.createCertificate("160.40.50.233", 8443);
            JFrame success = new JFrame();

            JOptionPane.showMessageDialog(success,
                    "Certificate was created for user " + username + ". Now the connection will start",
                    "Response Model Exported", JOptionPane.INFORMATION_MESSAGE);
        }

        try {
            sslContext = SSLContext.getInstance("TLS");
            sslContext.init(null, null, null);
            sf = new SSLSocketFactory(sslContext, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
        } catch (Exception e1) {
        }

        Scheme scheme = new Scheme("https", 8443, sf);
        httpclient.getConnectionManager().getSchemeRegistry().register(scheme);

        HttpGet httpget = new HttpGet(url + "/usr");
        httpget.addHeader(new BasicScheme().authenticate(usernamePasswordCredentials, httpget, localcontext));

        System.out.println("executing request: " + httpget.getRequestLine());

        HttpResponse response = httpclient.execute(httpget, localcontext);
        HttpEntity entity = response.getEntity();
        String responseString = EntityUtils.toString(entity, "UTF-8");
        System.out.println(responseString);

        DBObject dbo = (DBObject) JSON.parse(responseString);

        if (dbo.get("success").toString().equalsIgnoreCase("true")) {

            BasicDBList dataObj = (BasicDBList) dbo.get("data");

            DBObject dbo2 = (DBObject) dataObj.get(0);

            userID = dbo2.get("usr_id").toString();

            System.out.println("userId: " + userID);

            return true;
        } else {
            System.out.println(false);
            return false;
        }

    } finally {
    }

}

From source file:com.firmansyah.imam.sewa.kendaraan.FormLogin.java

private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLoginActionPerformed
    String username = inputUsername.getText();
    String passwordTemp = inputPassword.getText();
    String password;/* w ww . ja  va2s  .c om*/

    password = DigestUtils.md5Hex(passwordTemp);

    if (username.isEmpty() || password.isEmpty()) {

        JOptionPane.showMessageDialog(this, "Username / Password Tidak Boleh Kosong", "Informasi",
                JOptionPane.ERROR_MESSAGE);

    } else {

        String url = Path.serverURL + "/user/login/" + username + "/" + password;

        getDataURL dataurl = new getDataURL();

        try {
            String data = dataurl.getData(url);
            System.out.println(data);

            if (data.equals("1")) {

                JOptionPane.showMessageDialog(this, "Login Berhasil", "Informasi",
                        JOptionPane.INFORMATION_MESSAGE);
                this.dispose();

                System.out.println("Panggil Form Sewa");

                // memanggil form Sewa
                FormSewa callForm = new FormSewa();
                callForm.setLocationRelativeTo(null);
                callForm.setVisible(true);

            } else if (data.equals("2")) {

                JOptionPane.showMessageDialog(this, "Username Telah di Nonaktifkan", "Informasi",
                        JOptionPane.ERROR_MESSAGE);
                inputUsername.setText("");
                inputPassword.setText("");

            } else {

                JOptionPane.showMessageDialog(this, "Username / Password Salah", "Informasi",
                        JOptionPane.ERROR_MESSAGE);
                inputUsername.setText("");
                inputPassword.setText("");

            }

        } catch (IOException ex) {
            Logger.getLogger(FormLogin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

From source file:com.willwinder.universalgcodesender.MainWindow.java

/** Creates new form MainWindow */
public MainWindow(BackendAPI backend) {
    this.backend = backend;
    this.settings = SettingsFactory.loadSettings();
    try {//from  w  ww .j  a  v  a 2s  .com
        backend.applySettings(settings);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }

    if (settings.isShowNightlyWarning() && MainWindow.VERSION.contains("nightly")) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                String message = "This version of Universal Gcode Sender is a nightly build.\n"
                        + "It contains all of the latest features and improvements, \n"
                        + "but may also have bugs that still need to be fixed.\n" + "\n"
                        + "If you encounter any problems, please report them on github.";
                JOptionPane.showMessageDialog(new JFrame(), message, "", JOptionPane.INFORMATION_MESSAGE);
            }
        });
    }
    initComponents();
    initProgram();
    backend.addControllerListener(this);
    backend.addUGSEventListener(this);

    arrowMovementEnabled.setSelected(settings.isManualModeEnabled());
    stepSizeSpinner.setValue(settings.getManualModeStepSize());
    boolean unitsAreMM = settings.getDefaultUnits().equals("mm");
    mmRadioButton.setSelected(unitsAreMM);
    inchRadioButton.setSelected(!unitsAreMM);
    fileChooser = new JFileChooser(settings.getLastOpenedFilename());
    commPortComboBox.setSelectedItem(settings.getPort());
    baudrateSelectionComboBox.setSelectedItem(settings.getPortRate());
    scrollWindowCheckBox.setSelected(settings.isScrollWindowEnabled());
    checkScrollWindow();
    showVerboseOutputCheckBox.setSelected(settings.isVerboseOutputEnabled());
    showCommandTableCheckBox.setSelected(settings.isCommandTableEnabled());
    firmwareComboBox.setSelectedItem(settings.getFirmwareVersion());
    //        macroPanel.initMacroButtons(settings);

    setSize(settings.getMainWindowSettings().width, settings.getMainWindowSettings().height);
    setLocation(settings.getMainWindowSettings().xLocation, settings.getMainWindowSettings().yLocation);
    //        mw.setSize(java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().width, java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().width);

    initFileChooser();

    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            if (fileChooser.getSelectedFile() != null) {
                settings.setLastOpenedFilename(fileChooser.getSelectedFile().getAbsolutePath());
            }

            settings.setDefaultUnits(inchRadioButton.isSelected() ? "inch" : "mm");
            settings.setManualModeStepSize(getStepSize());
            settings.setManualModeEnabled(arrowMovementEnabled.isSelected());
            settings.setPort(commPortComboBox.getSelectedItem().toString());
            settings.setPortRate(baudrateSelectionComboBox.getSelectedItem().toString());
            settings.setScrollWindowEnabled(scrollWindowCheckBox.isSelected());
            settings.setVerboseOutputEnabled(showVerboseOutputCheckBox.isSelected());
            settings.setCommandTableEnabled(showCommandTableCheckBox.isSelected());
            settings.setFirmwareVersion(firmwareComboBox.getSelectedItem().toString());

            SettingsFactory.saveSettings(settings);

            if (pendantUI != null) {
                pendantUI.stop();
            }
        }
    });
}

From source file:edu.harvard.i2b2.patientMapping.serviceClient.IMQueryClient.java

public static String sendIsKeySetQueryRequestREST(String XMLstr) {
    try {//from  w  ww  . ja  v a  2s  .co  m
        SAXBuilder parser = new SAXBuilder();
        String xmlContent = XMLstr;
        java.io.StringReader xmlStringReader = new java.io.StringReader(xmlContent);
        org.jdom.Document tableDoc = parser.build(xmlStringReader);
        XMLOutputter o = new XMLOutputter();
        o.setFormat(Format.getPrettyFormat());
        StringWriter str = new StringWriter();
        o.output(tableDoc, str);

        MessageUtil.getInstance().setRequest("URL: " + getSetKeyServiceName() + "\n" + str);//XMLstr);

        OMElement payload = getQueryPayLoad(XMLstr);
        Options options = new Options();

        targetEPR = new EndpointReference(getValidateKeyServiceName());
        options.setTo(targetEPR);

        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
        options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
        options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(600000));
        options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(600000));

        ServiceClient sender = new ServiceClient();
        sender.setOptions(options);

        OMElement responseElement = sender.sendReceive(payload);
        MessageUtil.getInstance()
                .setResponse("URL: " + getSetKeyServiceName() + "\n" + responseElement.toString());

        return responseElement.toString();
    } catch (AxisFault axisFault) {
        axisFault.printStackTrace();
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                JOptionPane.showMessageDialog(null,
                        "Trouble with connection to the remote server, "
                                + "this is often a network error, please try again",
                        "Network Error", JOptionPane.INFORMATION_MESSAGE);
            }
        });

        return null;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}

From source file:com.googlecode.logVisualizer.LogVisualizer.java

private LogVisualizer() {
    try {/*from w w  w .j av a 2s .  c o m*/
        final String wantedLaf = Settings.getSettingString("LookAndFeel");
        LookAndFeelInfo usedLaf = null;
        for (final LookAndFeelInfo lafi : UIManager.getInstalledLookAndFeels())
            if (lafi.getName().equals(wantedLaf)) {
                usedLaf = lafi;
                break;
            }

        if (usedLaf != null)
            UIManager.setLookAndFeel(usedLaf.getClassName());
        else
            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (final Exception e) {
        e.printStackTrace();
    }

    gui = new LogVisualizerGUI(new LogLoaderListener() {
        public void loadMafiaLog(final File file) {
            loadLog(file, new MafiaLogParser(file, Settings.getSettingBoolean("Include mafia log notes")));
        }

        public void loadPreparsedLog(final File file) {
            loadLog(file, new PreparsedLogParser(file));
        }

        public void loadXMLLog(final File file) {
            try {
                final LogDataHolder logData = XMLLogReader.parseXMLLog(file);
                addLogGUI(file, logData);
            } catch (final FileAccessException e) {
                e.printStackTrace();
                JOptionPane.showMessageDialog(gui, "A problem occurred while reading the file.",
                        "Error occurred", JOptionPane.ERROR_MESSAGE);
            } catch (final XMLAccessException e) {
                e.printStackTrace();
                JOptionPane.showMessageDialog(gui, "A problem occurred while parsing the XML.",
                        "Error occurred", JOptionPane.ERROR_MESSAGE);
            }
        }
    });

    gui.setSize(800, 600);
    RefineryUtilities.centerFrameOnScreen(gui);
    gui.setVisible(true);

    if (Settings.getSettingBoolean("First program startup")) {
        final JLabel text = new JLabel(
                "<html>Note that <b>for the purpose of logging your own runs with KolMafia, it is best</b> to "
                        + "turn on all options but <i>Log adventures left instead of adventures used</i> under "
                        + "<i>General->Preferences->Session Logs</i> in KolMafia."
                        + "<br><br><br>This informational popup will only be displayed this once.</html>");
        text.setPreferredSize(new Dimension(550, 100));
        JOptionPane.showMessageDialog(gui, text, "KolMafia logging options", JOptionPane.INFORMATION_MESSAGE);

        Settings.setSettingBoolean("First program startup", false);
    }

    if (Settings.getSettingBoolean("Check Updates"))
        new Thread(new Runnable() {
            public void run() {
                if (ProjectUpdateViewer.isNewerVersionUploaded())
                    EventQueue.invokeLater(new Runnable() {
                        public void run() {
                            UpdateDialog.showDialog(gui);
                        }
                    });
            }
        }).start();
}

From source file:com.firmansyah.imam.sewa.kendaraan.FormRegister.java

private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegisterActionPerformed
    String nama = inputNama.getText();
    String nama_filter = nama.replaceAll(" ", "%20");

    String username = inputUsername.getText();
    String password = inputPassword.getText();
    String password_hash = DigestUtils.md5Hex(password);

    System.out.println("Nama : " + nama);
    System.out.println("Username : " + username);
    System.out.println("Password : " + password);

    if (nama.isEmpty() || username.isEmpty() || password.isEmpty()) {

        JOptionPane.showMessageDialog(this, "Data Tidak Boleh Kosong", "Informasi", JOptionPane.ERROR_MESSAGE);

    } else if (username.contains(" ")) {

        JOptionPane.showMessageDialog(this, "Username Tidak Boleh Menggunakan Spasi", "Informasi",
                JOptionPane.ERROR_MESSAGE);

    } else {//from   w ww  .j a  v  a 2s.  c o m

        String url = Path.serverURL + "/user/create/" + username + "/" + password_hash + "/" + nama_filter;

        getDataURL dataurl = new getDataURL();

        try {

            String data = dataurl.getData(url);
            System.out.println(data);

            if (data.equals("1")) {

                JOptionPane.showMessageDialog(this, "Registrasi Berhasil,\nSelamat Begabung " + nama,
                        "Informasi", JOptionPane.INFORMATION_MESSAGE);

                // memanggil form login
                FormLogin callForm = new FormLogin();
                callForm.setLocationRelativeTo(null);
                callForm.setVisible(true);

                this.dispose();

            } else {

                JOptionPane.showMessageDialog(this, "Registrasi Gagal\nUsername Sudah digunakan", "Informasi",
                        JOptionPane.ERROR_MESSAGE);

            }

        } catch (IOException ex) {
            Logger.getLogger(FormRegister.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

From source file:net.pms.newgui.GeneralTab.java

public JComponent build() {
    // Apply the orientation for the locale
    Locale locale = new Locale(configuration.getLanguage());
    ComponentOrientation orientation = ComponentOrientation.getOrientation(locale);
    String colSpec = FormLayoutUtil.getColSpec(COL_SPEC, orientation);

    FormLayout layout = new FormLayout(colSpec, ROW_SPEC);
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setBorder(Borders.DLU4_BORDER);
    builder.setOpaque(true);/*  ww w .  jav a  2s . c o m*/

    CellConstraints cc = new CellConstraints();

    smcheckBox = new JCheckBox(Messages.getString("NetworkTab.3"));
    smcheckBox.setContentAreaFilled(false);
    smcheckBox.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            configuration.setMinimized((e.getStateChange() == ItemEvent.SELECTED));
        }
    });

    if (configuration.isMinimized()) {
        smcheckBox.setSelected(true);
    }

    JComponent cmp = builder.addSeparator(Messages.getString("NetworkTab.5"),
            FormLayoutUtil.flip(cc.xyw(1, 1, 9), colSpec, orientation));
    cmp = (JComponent) cmp.getComponent(0);
    cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));
    builder.addLabel(Messages.getString("NetworkTab.0"),
            FormLayoutUtil.flip(cc.xy(1, 7), colSpec, orientation));
    final KeyedComboBoxModel kcbm = new KeyedComboBoxModel(
            new Object[] { "ar", "bg", "ca", "zhs", "zht", "cz", "da", "nl", "en", "fi", "fr", "de", "el", "iw",
                    "is", "it", "ja", "ko", "no", "pl", "pt", "br", "ro", "ru", "sl", "es", "sv", "tr" },
            new Object[] { "Arabic", "Bulgarian", "Catalan", "Chinese (Simplified)", "Chinese (Traditional)",
                    "Czech", "Danish", "Dutch", "English", "Finnish", "French", "German", "Greek", "Hebrew",
                    "Icelandic", "Italian", "Japanese", "Korean", "Norwegian", "Polish", "Portuguese",
                    "Portuguese (Brazilian)", "Romanian", "Russian", "Slovenian", "Spanish", "Swedish",
                    "Turkish" });
    langs = new JComboBox(kcbm);
    langs.setEditable(false);
    String defaultLang = null;
    if (configuration.getLanguage() != null && configuration.getLanguage().length() > 0) {
        defaultLang = configuration.getLanguage();
    } else {
        defaultLang = Locale.getDefault().getLanguage();
    }
    if (defaultLang == null) {
        defaultLang = "en";
    }
    kcbm.setSelectedKey(defaultLang);
    if (langs.getSelectedIndex() == -1) {
        langs.setSelectedIndex(0);
    }

    langs.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                configuration.setLanguage((String) kcbm.getSelectedKey());

            }
        }
    });

    builder.add(langs, FormLayoutUtil.flip(cc.xyw(3, 7, 7), colSpec, orientation));

    builder.add(smcheckBox, FormLayoutUtil.flip(cc.xyw(1, 9, 9), colSpec, orientation));

    JButton service = new JButton(Messages.getString("NetworkTab.4"));
    service.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            if (PMS.get().installWin32Service()) {
                JOptionPane.showMessageDialog(
                        (JFrame) (SwingUtilities.getWindowAncestor((Component) PMS.get().getFrame())),
                        Messages.getString("NetworkTab.11") + Messages.getString("NetworkTab.12"),
                        Messages.getString("Dialog.Information"), JOptionPane.INFORMATION_MESSAGE);

            } else {
                JOptionPane.showMessageDialog(
                        (JFrame) (SwingUtilities.getWindowAncestor((Component) PMS.get().getFrame())),
                        Messages.getString("NetworkTab.14"), Messages.getString("Dialog.Error"),
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    });

    builder.add(service, FormLayoutUtil.flip(cc.xy(1, 11), colSpec, orientation));

    if (System.getProperty(LooksFrame.START_SERVICE) != null || !Platform.isWindows()) {
        service.setEnabled(false);
    }

    JButton checkForUpdates = new JButton(Messages.getString("NetworkTab.8"));

    checkForUpdates.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            LooksFrame frame = (LooksFrame) PMS.get().getFrame();
            frame.checkForUpdates();
        }
    });

    builder.add(checkForUpdates, FormLayoutUtil.flip(cc.xy(1, 13), colSpec, orientation));

    autoUpdateCheckBox = new JCheckBox(Messages.getString("NetworkTab.9"));
    autoUpdateCheckBox.setContentAreaFilled(false);
    autoUpdateCheckBox.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            configuration.setAutoUpdate((e.getStateChange() == ItemEvent.SELECTED));
        }
    });

    if (configuration.isAutoUpdate()) {
        autoUpdateCheckBox.setSelected(true);
    }

    builder.add(autoUpdateCheckBox, FormLayoutUtil.flip(cc.xyw(7, 13, 3), colSpec, orientation));

    if (!Build.isUpdatable()) {
        checkForUpdates.setEnabled(false);
        autoUpdateCheckBox.setEnabled(false);
    }

    host = new JTextField(configuration.getServerHostname());
    host.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            configuration.setHostname(host.getText());
        }
    });

    port = new JTextField(configuration.getServerPort() != 5001 ? "" + configuration.getServerPort() : "");
    port.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            try {
                String p = port.getText();
                if (StringUtils.isEmpty(p)) {
                    p = "5001";
                }
                int ab = Integer.parseInt(p);
                configuration.setServerPort(ab);
            } catch (NumberFormatException nfe) {
                logger.debug("Could not parse port from \"" + port.getText() + "\"");
            }

        }
    });

    cmp = builder.addSeparator(Messages.getString("NetworkTab.22"),
            FormLayoutUtil.flip(cc.xyw(1, 21, 9), colSpec, orientation));
    cmp = (JComponent) cmp.getComponent(0);
    cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));

    final KeyedComboBoxModel networkInterfaces = createNetworkInterfacesModel();
    networkinterfacesCBX = new JComboBox(networkInterfaces);
    networkInterfaces.setSelectedKey(configuration.getNetworkInterface());
    networkinterfacesCBX.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                configuration.setNetworkInterface((String) networkInterfaces.getSelectedKey());
            }
        }
    });

    ip_filter = new JTextField(configuration.getIpFilter());
    ip_filter.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            configuration.setIpFilter(ip_filter.getText());
        }
    });

    maxbitrate = new JTextField(configuration.getMaximumBitrate());
    maxbitrate.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            PMS.getConfiguration().setMaximumBitrate(maxbitrate.getText());
        }
    });

    builder.addLabel(Messages.getString("NetworkTab.20"),
            FormLayoutUtil.flip(cc.xy(1, 23), colSpec, orientation));
    builder.add(networkinterfacesCBX, FormLayoutUtil.flip(cc.xyw(3, 23, 7), colSpec, orientation));
    builder.addLabel(Messages.getString("NetworkTab.23"),
            FormLayoutUtil.flip(cc.xy(1, 25), colSpec, orientation));
    builder.add(host, FormLayoutUtil.flip(cc.xyw(3, 25, 7), colSpec, orientation));
    builder.addLabel(Messages.getString("NetworkTab.24"),
            FormLayoutUtil.flip(cc.xy(1, 27), colSpec, orientation));
    builder.add(port, FormLayoutUtil.flip(cc.xyw(3, 27, 7), colSpec, orientation));
    builder.addLabel(Messages.getString("NetworkTab.30"),
            FormLayoutUtil.flip(cc.xy(1, 29), colSpec, orientation));
    builder.add(ip_filter, FormLayoutUtil.flip(cc.xyw(3, 29, 7), colSpec, orientation));
    builder.addLabel(Messages.getString("NetworkTab.35"),
            FormLayoutUtil.flip(cc.xy(1, 31), colSpec, orientation));
    builder.add(maxbitrate, FormLayoutUtil.flip(cc.xyw(3, 31, 7), colSpec, orientation));

    cmp = builder.addSeparator(Messages.getString("NetworkTab.31"),
            FormLayoutUtil.flip(cc.xyw(1, 33, 9), colSpec, orientation));
    cmp = (JComponent) cmp.getComponent(0);
    cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));

    newHTTPEngine = new JCheckBox(Messages.getString("NetworkTab.32"));
    newHTTPEngine.setSelected(configuration.isHTTPEngineV2());
    newHTTPEngine.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            configuration.setHTTPEngineV2((e.getStateChange() == ItemEvent.SELECTED));
        }
    });
    builder.add(newHTTPEngine, FormLayoutUtil.flip(cc.xyw(1, 35, 9), colSpec, orientation));

    preventSleep = new JCheckBox(Messages.getString("NetworkTab.33"));
    preventSleep.setSelected(configuration.isPreventsSleep());
    preventSleep.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            configuration.setPreventsSleep((e.getStateChange() == ItemEvent.SELECTED));
        }
    });
    builder.add(preventSleep, FormLayoutUtil.flip(cc.xyw(1, 37, 9), colSpec, orientation));

    JCheckBox fdCheckBox = new JCheckBox(Messages.getString("NetworkTab.38"));
    fdCheckBox.setContentAreaFilled(false);
    fdCheckBox.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            configuration.setRendererForceDefault((e.getStateChange() == ItemEvent.SELECTED));
        }
    });

    if (configuration.isRendererForceDefault()) {
        fdCheckBox.setSelected(true);
    }

    builder.addLabel(Messages.getString("NetworkTab.36"),
            FormLayoutUtil.flip(cc.xy(1, 39), colSpec, orientation));

    ArrayList<RendererConfiguration> allConfs = RendererConfiguration.getAllRendererConfigurations();
    ArrayList<Object> keyValues = new ArrayList<Object>();
    ArrayList<Object> nameValues = new ArrayList<Object>();
    keyValues.add("");
    nameValues.add(Messages.getString("NetworkTab.37"));

    if (allConfs != null) {
        for (RendererConfiguration renderer : allConfs) {
            if (renderer != null) {
                keyValues.add(renderer.getRendererName());
                nameValues.add(renderer.getRendererName());
            }
        }
    }

    final KeyedComboBoxModel renderersKcbm = new KeyedComboBoxModel(
            (Object[]) keyValues.toArray(new Object[keyValues.size()]),
            (Object[]) nameValues.toArray(new Object[nameValues.size()]));
    renderers = new JComboBox(renderersKcbm);
    renderers.setEditable(false);
    String defaultRenderer = configuration.getRendererDefault();
    renderersKcbm.setSelectedKey(defaultRenderer);

    if (renderers.getSelectedIndex() == -1) {
        renderers.setSelectedIndex(0);
    }

    builder.add(renderers, FormLayoutUtil.flip(cc.xyw(3, 39, 7), colSpec, orientation));

    builder.add(fdCheckBox, FormLayoutUtil.flip(cc.xyw(1, 41, 9), colSpec, orientation));

    cmp = builder.addSeparator(Messages.getString("NetworkTab.34"),
            FormLayoutUtil.flip(cc.xyw(1, 43, 9), colSpec, orientation));
    cmp = (JComponent) cmp.getComponent(0);
    cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));

    pPlugins = new JPanel(new GridLayout());
    builder.add(pPlugins, FormLayoutUtil.flip(cc.xyw(1, 45, 9), colSpec, orientation));

    JPanel panel = builder.getPanel();

    // Apply the orientation to the panel and all components in it
    panel.applyComponentOrientation(orientation);

    JScrollPane scrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    return scrollPane;
}