I'm a newbie in Java and my first code, is to make a JFrame modal window that you can modify the background and have a button, but I do not get it, I do not know why:
package practica1;
import javax.swing.*;
import java.awt.Color;
public class pantalla extends JFrame{
public static void main(String[] args) {
pantalla v = new pantalla12();
v.setVisible(true);
v.setBounds(300,400,2000, 1000);
v.setTitle("hola");
v.setBackground(Color.green);
}
}
pantalla12.java
package practica1;
public class pantalla12 extends pantalla {
JButton boton;
JPanel panel;
this(panel);
panel.add(boton);
}
I only get the modal window without the background but the rest is not.
Why will it be?
Thanks