port.setText(Integer.toString(proxySettings.getPort()));
port.setDocument(new NumberInputVerifier()); if (proxySettings.getPort()!=-1){ port.setText(Integer.toString(proxySettings.getPort())); }
    private void init() throws Exception {        setLayout(new BorderLayout());        JPanel panel1 = new JPanel(new GridBagLayout());        FlowLayout flowL = new FlowLayout();        flowL.setAlignment(FlowLayout.RIGHT);        JPanel panel2 = new JPanel(flowL);        LanguageSelector languageSelector = LanguageSelector.getInstance();        proxySettings = PropertiesManager.getProxyManager().getProxySettings();        label1 = new JLabel(ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "options", "proxy",                                                                                                     "host"})));        label2 = new JLabel(ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "options", "proxy",                                                                                                     "port"})));        label3 = new JLabel(ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "options", "proxy",                                                                                                     "benutzername"})));        label4 = new JLabel(ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "options", "proxy",                                                                                                     "passwort"})));        use.setText(ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "options", "proxy",                                                                                                     "verwenden"})));        host.setText(proxySettings.getHost());        host.addFocusListener(new FocusAdapter() {            public void focusLost(FocusEvent e) {                if (proxySettings.getHost().compareTo(host.getText()) != 0)                {                    dirty = true;                }            }        });        port.setText(Integer.toString(proxySettings.getPort()));        port.addFocusListener(new FocusAdapter() {            public void focusLost(FocusEvent e) {                if (Integer.toString(proxySettings.getPort()).compareTo(host.getText()) != 0)                {                    dirty = true;                }            }        });        user.addFocusListener(new FocusAdapter() {            public void focusLost(FocusEvent e) {                dirty = true;            }        });        passwort.addFocusListener(new FocusAdapter() {            public void focusLost(FocusEvent e) {                dirty = true;            }        });        use.setSelected(proxySettings.isUse());        use.addChangeListener(new ChangeListener(){            public void stateChanged(ChangeEvent e) {                dirty = true;            }        });        GridBagConstraints constraints = new GridBagConstraints();        constraints.anchor = GridBagConstraints.NORTH;        constraints.fill = GridBagConstraints.BOTH;        constraints.gridx = 0;        constraints.gridy = 0;        constraints.insets.top = 5;        constraints.insets.left = 5;        panel1.add(label1, constraints);        constraints.gridy = 1;        panel1.add(label2, constraints);        constraints.gridy = 2;        panel1.add(label3, constraints);        constraints.gridy = 3;        panel1.add(label4, constraints);        constraints.insets.right = 5;        constraints.gridy = 0;        constraints.gridx = 1;        constraints.weightx = 1;        panel1.add(host, constraints);        constraints.gridy = 1;        panel1.add(port, constraints);        constraints.gridy = 2;        panel1.add(user, constraints);        constraints.gridy = 3;        panel1.add(passwort, constraints);        constraints.gridy = 4;        constraints.gridx = 0;        constraints.gridwidth = 2;        panel2.add(use);        panel1.add(panel2, constraints);        add(panel1, BorderLayout.NORTH);    }