Zitat Zitat von haggys22 Beitrag anzeigen
Ich hätte das ganze so gelöst:
Code:
jButton1.setBounds(82, 94, 105, 23);
jTextField1.setText("Search");
Action action_ENTER = new AbstractAction() {
    public void actionPerformed(ActionEvent e) {
        boolean b = jRadioButton1.isSelected();
        boolean c = jRadioButton2.isSelected();
        String search = jTextField1.getText();
        if (b!=false){
            String kompsearch = "http://www.google.de/#hl=de&q=" + search+"&aq=f&aqi=g10&aql=&oq=&gs_rfai=&fp=95d8f914f306e11a";
            try {
                Desktop.getDesktop().browse(new URI(kompsearch.replace(' ', '+')));
            } catch (IOException e) {
                e.printStackTrace();
            } catch (URISyntaxException e) {
                e.printStackTrace();
            }
        }
        else if (c!=false)
        {
            String kompsearch = "http://www.bing.com/search?q="+search+"&go=&form=QBLH&filt=all";
            try {
                Desktop.getDesktop().browse(new URI(kompsearch.replace(' ', '+')));
            } catch (IOException e) {
                e.printStackTrace();
            } catch (URISyntaxException e) {
                e.printStackTrace();
            }
        }
    }
};
jTextField1.getInputMap().put(KeyStroke.getKeyStroke("ENTER"),"ENTER");
jTextField1.getActionMap().put("ENTER", action_ENTER);
getContentPane().add(jTextField1);

Sehr gut danke funktioniert.