30 lines
965 B
Java
30 lines
965 B
Java
|
import javax.swing.*;
|
||
|
import java.awt.event.*;
|
||
|
|
||
|
public class taille_su extends JFrame implements ActionListener {
|
||
|
private JFrame cette_frame;
|
||
|
private JTextField ce_tfield;
|
||
|
private ButtonGroup ce_group;
|
||
|
|
||
|
public taille_su(JFrame une_frame, JTextField un_tfield, ButtonGroup group){
|
||
|
this.cette_frame = une_frame;
|
||
|
this.ce_tfield = un_tfield;
|
||
|
this.ce_group = group;
|
||
|
}
|
||
|
|
||
|
public void actionPerformed(ActionEvent e){
|
||
|
this.cette_frame.dispose();
|
||
|
|
||
|
String valleur_taille = this.ce_tfield.getText();
|
||
|
|
||
|
if(this.ce_group.getSelection().getActionCommand()=="Grille randomisée"){
|
||
|
FenetreRndmGrille cette_fenetre = new FenetreRndmGrille(Integer.parseInt(valleur_taille));
|
||
|
cette_fenetre.RandomGrille();
|
||
|
}
|
||
|
|
||
|
else if(this.ce_group.getSelection().getActionCommand()=="Grille vide"){
|
||
|
FenetreVideGrille cette_fenetre = new FenetreVideGrille();
|
||
|
cette_fenetre.create_empty(Integer.parseInt(valleur_taille));
|
||
|
}
|
||
|
}
|
||
|
}
|