kann mir jemand sagen warum sich bei mir nichts tut wenn ich es ausgeben will?
sowohl der button als auch die "enter"-taste geht nicht!
package uebeung;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class aufgabe9 implements ActionListener {
private JButton meinknopf;
private JTextField textfeld;
private JLabel text;
aufgabe9(){
JFrame container9 = new JFrame("Aufgabe9");
container9.getContentPane().setLayout(new FlowLayout());
container9.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
container9.setSize(300,300);
meinknopf = new JButton("Knopf");
meinknopf.addActionListener(this);
container9.getContentPane().add(meinknopf);
textfeld = new JTextField(8);
textfeld.addActionListener(this);
container9.getContentPane().add(textfeld);
text = new JLabel("xxx");
container9.getContentPane().add(text);
container9.setVisible(true);
}
public void actionPerformed(ActionEvent meinEreignis) {
String inhalt = text.getText();
text.setText(inhalt);
}
}