G
Gast
Gast
moin!
ich schreibe ein kleines programm. dazu brauch eine texteingabe. das hab ich mir so geadacht(also nur das textfeld):
das problem ist, dass mir das feld mal angezeigt wird und mal wieder nicht. woran liegt das?
ich schreibe ein kleines programm. dazu brauch eine texteingabe. das hab ich mir so geadacht(also nur das textfeld):
Code:
import javax.swing.*;
public class textfield {
public textfield(){
JFrame frame = new JFrame();
JTextField textfield = new JTextField();
frame.setSize(500, 500);
frame.setLayout(null);
frame.setVisible(true);
textfield.setBounds(50, 50, 50, 50);
frame.add(textfield);
}
public static void main(String[] args) {
textfield t = new textfield();
}
}
das problem ist, dass mir das feld mal angezeigt wird und mal wieder nicht. woran liegt das?