Eclipse - Run Fehler?

DasLama

Neues Mitglied
Hallo JavaFreunde,

Bei "Run" wird mir kein Ergebnis angezeigt (Eclipse).
Erst wenn ich das Fenster größer oder kleiner ziehe, mit der Maus. siehe Bilder
Das Problem tritt immer dann auf, wenn ich Anfange mit Labels, Panels im JFrame herumzuhantieren...

Weiß jemand warum?

Danke im Voraus. :rtfm:

Vorher:
Gyazo - 97e89e47f5a4951aa481ee8788af4ce5.png
Nachher:
Gyazo - 03ab81943f9e6334b987f8d93060915a.png

Java:
public class hauptGUI3 {
	
	public static void main(String args[]){
		JFrame f = new JFrame();
		f.setSize(300, 200);
		f.setVisible(true);
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setLocationRelativeTo(null);
		f.setResizable(true);
		f.setBackground(Color.ORANGE);
		
		JLabel l1 = new JLabel("Text");
		JTextField t1 = new JTextField("",10);
		
		JPanel ContainerPanel = new JPanel();
		ContainerPanel.setBackground(Color.BLACK);
		
		ContainerPanel.add(l1);
		ContainerPanel.add(t1);
		f.add(ContainerPanel);
		
	}
}
 

Zurück
Oben