first commit
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
package fr.iutflbeau.projet.view;
|
||||
import fr.iutfbleau.projet.controller.ValidationChoix;
|
||||
import fr.iutfbleau.projet.modele.*;
|
||||
|
||||
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
|
||||
public class FenetreQuizz extends JFrame implements ActionListener {
|
||||
|
||||
private Question[] questionsquiz;
|
||||
private ChoixUitlisateur choix;
|
||||
private int index = 0;
|
||||
private boolean valide = false;
|
||||
|
||||
private JPanel zoneCentre new JPanel(new BorderLayout());
|
||||
private JButton boutonPrecedent = new JButton("Précédent");
|
||||
private JButton boutonSuivant = new JButton("Suivant");
|
||||
private JButton boutonValider = new JButton("Valider");
|
||||
|
||||
private EcranQuestion EcranDeBase;
|
||||
|
||||
public FenetreQuizz(Question[] questionsquiz) {
|
||||
|
||||
|
||||
super("QCM");
|
||||
this.questionsquiz = questionsquiz;
|
||||
this.choix = new ChoixUitlisateur(questionsquiz.length);
|
||||
this.setLayout(new BorderLayout());
|
||||
this.add(zoneCentre, BorderLayout.CENTER);
|
||||
|
||||
boutonSuivant.addActionListener(this);
|
||||
boutonPrecedent.addActionListener(this);
|
||||
boutonValider.addActionListener(this);
|
||||
|
||||
mettreAJourEcran();
|
||||
|
||||
this.setSize(520, 320);
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e){
|
||||
|
||||
Object source = e.getSource();
|
||||
|
||||
|
||||
if(source == boutonPrecedent){
|
||||
|
||||
AllerPrecedent();
|
||||
|
||||
}
|
||||
|
||||
if(source == boutonSuivant){
|
||||
|
||||
AllerSuivant();
|
||||
}
|
||||
|
||||
if(source == boutonValider) {
|
||||
|
||||
Valider();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user