Das Jlabel label wird nicht angezeigt, ich weiß grade nicht, was ich falsch mache. Ich würde mich über Hilfe sehr freuen.
Grüße
Tischbein
Java:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Test extends JFrame{
private JLabel label=new JLabel("text zum testen");
private JButton button=new JButton("test");
Test(){
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setBounds(100, 100, 900, 800);
this.setLayout(new BorderLayout());
this.add("South",button);
this.add("North",label);
this.setVisible(true);
this.setBackground(Color.yellow);
}
public static void main(String args[]) {
new Test();
}
public void paint(Graphics g) {
}
}
Grüße
Tischbein