if (quickConnectionSettingsDialog != null){ passwortNeu.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent ke) { if (ke.getKeyCode() == KeyEvent.VK_ENTER) { dirty = true; remote.setNewPassword(new String(passwortNeu.getPassword())); quickConnectionSettingsDialog.pressOK(); } else{ super.keyPressed(ke); } } }); }
    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();        label1 = new JLabel(ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "options", "remote",                                                                                                     "host"})));        label2 = new JLabel(ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "options", "remote",                                                                                                     "passwortAlt"})));        label3 = new JLabel(ZeichenErsetzer.korrigiereUmlaute(languageSelector.                                                              getFirstAttrbuteByTagName(new String[]{"javagui", "options", "remote",                                                                                                     "passwortNeu"})));        label4 = new JLabel("Port");        host.setText(remote.getHost());        host.addFocusListener(new FocusAdapter() {            public void focusLost(FocusEvent e) {                if (remote.getHost().compareTo(host.getText()) != 0)                {                    dirty = true;                    remote.setHost(host.getText());                }            }        });        passwortAlt.addFocusListener(new FocusAdapter() {            public void focusLost(FocusEvent e) {                dirty = true;                remote.setOldPassword(new String(passwortAlt.getPassword()));            }        });        passwortNeu.addFocusListener(new FocusAdapter() {            public void focusLost(FocusEvent e) {                dirty = true;                remote.setNewPassword(new String(passwortNeu.getPassword()));            }        });        port.setDocument(new NumberInputVerifier());        port.setText(Integer.toString(remote.getXmlPort()));        port.addFocusListener(new FocusAdapter() {            public void focusLost(FocusEvent e) {                dirty = true;                remote.setXmlPort(Integer.parseInt(port.getText()));            }        });        enableControls(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);        int gridy = 1;        if (showPort){            constraints.gridy = gridy;            gridy++;            panel1.add(label4, constraints);        }        constraints.gridy = gridy;        gridy++;        panel1.add(label2, constraints);        constraints.gridy = gridy;        gridy++;        panel1.add(label3, constraints);        constraints.insets.right = 5;        constraints.gridy = 0;        constraints.gridx = 1;        constraints.weightx = 1;        panel1.add(host, constraints);        gridy = 1;        if (showPort){            constraints.gridy = gridy;            gridy++;            panel1.add(port, constraints);        }        constraints.gridy = gridy;        gridy++;        panel1.add(passwortAlt, constraints);        constraints.gridy = gridy;        gridy++;        panel1.add(passwortNeu, constraints);        constraints.gridy = gridy;        gridy++;        constraints.gridx = 0;        constraints.gridwidth = 2;        panel1.add(panel2, constraints);        add(panel1, BorderLayout.NORTH);    }