0
I am studying Swing with the Java Programmer’s Guide book, and this code does not validate.
import javax.swing.*;
@SuppressWarnings("serial")
public class Main extends JFrame{
public Main() {
super(); //ajusta o titulo
setBounds(50, 50, 250, 90); //ajusta a posição e tamanho
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //ação fechar
add(new JLabel("Janela")); //conteúdo
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Main principal = new Main(); //crai a janela principal
principal.setVisible(true); //exibe a janela principal
SwingDialog dialogo = SwingDialog (principal, true); //cria dialogo //AQUI INFORMA UM ERROR FATAL
dialogo.setVisible(true); //exibe dialogo
}
}
); } }
Help me........
– Ricardo Junior Oliveira