|
package quizzone;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class Getname extends JFrame {
public Getname() {
super("Name");
this. setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE);
d.setText("Inserisci il tuo nome");
d. setFont(new Font("Arial", Font. BOLD, 18 ));
nome. setBackground(Color. YELLOW);
nome. setFont(new Font("Arial", Font. BOLD, 14 ));
this.getContentPane().add(d, "North");
this.getContentPane().add(nome, "Center");
this.getContentPane().add(start, "South");
this. getContentPane(). setBackground(Color. red);
pack();
setResizable(false);
setVisible(true);
setLocation(460, 240);
start.addActionListener(
if (!nome.getText().equals("")) {
new Myframe(nome.getText());
setVisible(false);
}
}
});
}
}
|
|