bonjour, j'ai fait il y a quelque mois que j'est fait un jeu plus ou moins sur console (il n'y a pas de problème la sur celui là)
mais je travaille sur le même jeu mais avec un JFrame voici le si vous pouvez corriger mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
 
package PlusOuMoin;
 
import java.awt.GridLayout;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
 
 
 
public class Main extends JFrame{
    //on definie les objets
    private static GridLayout layout = new GridLayout(2,2);   
    private static int nombreSe = (int)(Math.random()*999)+1;
    private static JTextField entr = new JTextField();
    private static JLabel entrUnNbr = new JLabel("nombre: ");
    private static JLabel PlusOuMoin = new JLabel("plus ou moin?");
    private static JLabel remplissage = new JLabel("");
    private static JButton validé = new JButton("validé");
    private static JButton quitter = new JButton("abandonner");
 
    public Main(){
 
    JPanel b1 = new JPanel();
    JPanel b3 = new JPanel();
    JPanel b2 = new JPanel();
    b3.setLayout(new BoxLayout(b3, BoxLayout.LINE_AXIS));
    //Ligne 1
    b3.add(entrUnNbr);
    b3.add(entr);
    //On définit le layout en lui indiquant qu'il travaillera en ligne
    //Ligne 3
    b1.setLayout(new BoxLayout(b1, BoxLayout.LINE_AXIS));
    b1.add(validé);
    b1.add(quitter);
 
    b2.setLayout(new BoxLayout(b2, BoxLayout.LINE_AXIS));
    //Ligne 2
    b2.add(new JLabel("plus ou moin"));
 
    JPanel b4 = new JPanel();
    //On positionne maintenant ces trois lignes en colonne
    b4.setLayout(new BoxLayout(b4, BoxLayout.PAGE_AXIS));
    b4.add(b3);
    b4.add(b2);
    b4.add(b1);
 
    this.getContentPane().add(b4);
 
    this.getContentPane().add(b4);
    this.setVisible(true);
    }
 
 
    public static void main(String[] args) {//on appelle les methodes
        Main framep = new Main();
        écoute();
        framep.pack();
        framep.setVisible(true);
        framep.setDefaultCloseOperation(EXIT_ON_CLOSE);
    }
    //on écoute
    public static void écoute(){
        validé.addActionListener((it) -> calcul());
        quitter.addActionListener((it) ->ft());
 
    }
 
    public static void ft(){//on quitte l'application
        System.err.println("vous avez quitter le jeu =(");
        System.exit(0);
    }
 
    public static void calcul(){//on calcul si c'est plus ou moins(le problème est ici)
        String recuperer;
        int pito;
 
        recuperer = entr.getText();
        pito = Integer.decode(recuperer);
 
        if (pito == nombreSe){
 
            PlusOuMoin.setText("vous avez gagné!");
        }else if(pito<0){
 
            PlusOuMoin.setText("sans commentaire");
 
        }else if(pito >1000){
 
            PlusOuMoin.setText("le nombre maxi est mille!");
 
        }else if(pito>nombreSe){
 
            PlusOuMoin.setText("plus petit");
 
        }else if(pito<nombreSe){
 
           PlusOuMoin.setText("plus grand!");
    }
 
}
}
si sa serait possible de me dire où est le problème
merci