IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

avec Java Discussion :

Mon programme ne fonctionne pas comme je veux


Sujet :

avec Java

  1. #1
    Membre régulier Avatar de menoulette
    Inscrit en
    Août 2009
    Messages
    320
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 320
    Points : 111
    Points
    111
    Par défaut Mon programme ne fonctionne pas comme je veux
    Bonsoir à vous tous , je souhaite afficher une fenêtre contenant un bouton et lorsque on clique sur le boutton ça me redirige vers une autre fenêtre le code celui là interprète ce que je veux mais le problème c'est qu'il fonctionne pas
    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
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
     
     
    package projet;
     
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JButton;
    import java.awt.Dimension;
    import java.awt.Rectangle;
    import javax.swing.JLabel;
    import javax.swing.JPasswordField;
    import javax.swing.JTextField;
    import javax.swing.JList;
    import javax.swing.JToggleButton;
    import javax.swing.JProgressBar;
    import  javax.swing.*;
    import  java.awt.*;
    import java.awt.Font;
    import java.awt.Color;
    import javax.swing.AbstractAction;
    import java.awt.event.ActionEvent;
    import javax.swing.Action;
    import java.beans.PropertyChangeListener;
    import java.lang.Object;
    import java.lang.String;
    import javax.swing.text.TextAction;
    import java.awt.ComponentOrientation;
     
     
    public class INTER extends JFrame {
     
    	private static final long serialVersionUID = 1L;
     
    	private JPanel jContentPane = null;
     
     
     
    	private JButton entrée = null;
     
    	private JToggleButton jToggleButton = null;
     
    	private JLabel jLabel = null;
     
    	private JButton jButton = null;
     
    	public INTER() {
    		super();
    		initialize();
     
    	}
     
     
    	private void initialize() {
    		this.setSize(1046, 286);
    		this.setContentPane(getJContentPane());
    		this.setTitle("Accueil Sonelgaz Aplication");
     
    	}
     
    	private JPanel getJContentPane() {
    		if (jContentPane == null) {
    			jLabel = new JLabel();
    			jLabel.setBounds(new Rectangle(313, 18, 307, 32));
    			jLabel.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 24));
    			jLabel.setBackground(new Color(238, 238, 137));
    			jLabel.setForeground(new Color(51, 123, 51));
    			jLabel.setText("     Faite votre choix merci");
    			jContentPane = new JPanel();
    			jContentPane.setLayout(null);
    			jContentPane.setVisible(true);
    			jContentPane.setBackground(new Color(255, 225, 0));
    			jContentPane.add(getEntrée(), null);
    			jContentPane.add(getJToggleButton(), null);
    			jContentPane.add(jLabel, null);
    			jContentPane.add(getJButton(), null);
    			jContentPane.add(getOwner(), BorderLayout.CENTER);
    		}
    		return jContentPane;
    	}
     
    	/**
             * This method initializes entrée      
             *      
             * @return javax.swing.JButton  
             */
    	private JButton getEntrée() {
    		if (entrée == null) {
    			entrée = new JButton();
    			entrée.setBounds(new Rectangle(384, 165, 190, 32));
    			entrée.setFont(new Font("Andalus", Font.BOLD | Font.ITALIC, 18));
    			entrée.setBackground(new Color(217, 150, 135));
    			entrée.setForeground(new Color(51, 51, 154));
    			entrée.setText("Liste des incidents");
    		}
    		return entrée;
    	}
     
     
    	private JToggleButton getJToggleButton() {
    		if (jToggleButton == null) {
    			jToggleButton = new JToggleButton();
     
    			jToggleButton.setBounds(new Rectangle(143, 102, 206, 36));
    			jToggleButton.setText("Saisie d'un incident");
    			jToggleButton.setFont(new Font("Andalus", Font.BOLD | Font.ITALIC, 18));
    			jToggleButton.setBackground(new Color(217, 150, 135));
    			jToggleButton.setComponentOrientation(ComponentOrientation.UNKNOWN);
    			jToggleButton.setForeground(new Color(51, 51, 154));
    			jToggleButton.setVisible(true);
    			jToggleButton.addActionListener(new java.awt.event.ActionListener() {
    				public void actionPerformed(java.awt.event.ActionEvent e) {
     
    					new Sorti1().setVisible(true); 
    					jToggleButton.setVisible(false); 
     
    					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
     
    				}
     
    			});
    			jToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
    				public void mouseClicked(java.awt.event.MouseEvent e) {
    					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
    					new Sorti1().setVisible(true); 
    					jToggleButton.setVisible(false); 
    }
    			});
    		}
    		return jToggleButton;
    	}
     
     
    	private JButton getJButton() {
    		if (jButton == null) {
    			jButton = new JButton();
    			jButton.setBounds(new Rectangle(596, 103, 236, 31));
    			jButton.setFont(new Font("Andalus", Font.BOLD | Font.ITALIC, 18));
    			jButton.setBackground(new Color(217, 150, 135));
    			jButton.setForeground(new Color(51, 51, 154));
    			jButton.setText("Nombre d'incidents");
    		}
    		return jButton;
    	}
     
    }
     
     
     
    //*********************************************************************************************************************//
     
     
     
    package projet;
     
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.Dimension;
    import javax.swing.JTextField;
    import java.awt.Rectangle;
    import javax.swing.JScrollBar;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JTextArea;
    import javax.swing.JComboBox;
    import javax.swing.JLabel;
    import javax.swing.JButton;
     
    public class Sorti1 extends JFrame {
     
    	private static final long serialVersionUID = 1L;
     
    	private JPanel jContentPane = null;
     
    	private JComboBox jComboBox = null;
     
    	private JLabel jLabel = null;
     
    	private JLabel jLabel1 = null;
     
    	private JComboBox jComboBox1 = null;
     
    	private JComboBox jComboBox2 = null;
     
    	private JComboBox jComboBox3 = null;
     
    	private JComboBox jComboBox4 = null;
     
    	private JLabel jLabel2 = null;
     
    	private JLabel jLabel3 = null;
     
    	private JLabel jLabel4 = null;
     
    	private JButton jButton = null;
     
     
    	public Sorti1() {
    		super();
    		initialize();
    	}
     
     
    	private void initialize() {
    		this.setSize(767, 324);
    		this.setContentPane(getJContentPane());
    		this.setTitle("Formulaire pou incident");
    	}
     
     
    	private JPanel getJContentPane() {
    		if (jContentPane == null) {
    			jLabel4 = new JLabel();
    			jLabel4.setBounds(new Rectangle(28, 175, 136, 28));
    			jLabel4.setText("JLabel");
    			jLabel3 = new JLabel();
    			jLabel3.setBounds(new Rectangle(26, 136, 137, 28));
    			jLabel3.setText("JLabel");
    			jLabel2 = new JLabel();
    			jLabel2.setBounds(new Rectangle(29, 90, 129, 34));
    			jLabel2.setText("JLabel");
    			jLabel1 = new JLabel();
    			jLabel1.setBounds(new Rectangle(30, 56, 131, 27));
    			jLabel1.setText("JLabel");
    			jLabel = new JLabel();
    			jLabel.setBounds(new Rectangle(31, 14, 134, 30));
    			jLabel.setText("JLabel");
    			jContentPane = new JPanel();
    			jContentPane.setLayout(null);
    			jContentPane.add(getJComboBox(), null);
    			jContentPane.add(jLabel, null);
    			jContentPane.add(jLabel1, null);
    			jContentPane.add(getJComboBox1(), null);
    			jContentPane.add(getJComboBox2(), null);
    			jContentPane.add(getJComboBox3(), null);
    			jContentPane.add(getJComboBox4(), null);
    			jContentPane.add(jLabel2, null);
    			jContentPane.add(jLabel3, null);
    			jContentPane.add(jLabel4, null);
    			jContentPane.add(getJButton(), null);
     
    		}
    		return jContentPane;
    	}
     
     
    	private JComboBox getJComboBox() {
    		if (jComboBox == null) {
    			jComboBox = new JComboBox();
    			jComboBox.setBounds(new Rectangle(187, 15, 187, 30));
    		}
    		return jComboBox;
    	}
     
     
    	private JComboBox getJComboBox1() {
    		if (jComboBox1 == null) {
    			jComboBox1 = new JComboBox();
    			jComboBox1.setBounds(new Rectangle(184, 56, 189, 30));
    		}
    		return jComboBox1;
    	}
     
     
    	private JComboBox getJComboBox2() {
    		if (jComboBox2 == null) {
    			jComboBox2 = new JComboBox();
    			jComboBox2.setBounds(new Rectangle(184, 92, 188, 31));
    		}
    		return jComboBox2;
    	}
     
     
    	private JComboBox getJComboBox3() {
    		if (jComboBox3 == null) {
    			jComboBox3 = new JComboBox();
    			jComboBox3.setBounds(new Rectangle(185, 138, 188, 27));
    		}
    		return jComboBox3;
    	}
     
    	private JComboBox getJComboBox4() {
    		if (jComboBox4 == null) {
    			jComboBox4 = new JComboBox();
    			jComboBox4.setBounds(new Rectangle(182, 178, 192, 28));
    		}
    		return jComboBox4;
    	}
     
     
    	private JButton getJButton() {
    		if (jButton == null) {
    			jButton = new JButton();
    			jButton.setBounds(new Rectangle(336, 260, 110, 27));
    			jButton.setText("Entré");
    		}
    		return jButton;
    	}
     
    }



    Si vous avez des idées n'hésitez pas à me diriger SVP MErci d'avance

  2. #2
    Futur Membre du Club
    Profil pro
    Inscrit en
    Avril 2011
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2011
    Messages : 5
    Points : 5
    Points
    5
    Par défaut
    Déja il semble te manquer la méthode this.setvisible(true); permettant d'afficher ta JFrame

  3. #3
    Membre régulier Avatar de menoulette
    Inscrit en
    Août 2009
    Messages
    320
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 320
    Points : 111
    Points
    111
    Par défaut
    ouii merci,, je lé fais mais mm avec ça... ça marche tjrs pas !!!

  4. #4
    Membre régulier Avatar de menoulette
    Inscrit en
    Août 2009
    Messages
    320
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 320
    Points : 111
    Points
    111
    Par défaut
    Citation Envoyé par nainnain6 Voir le message
    Déja il semble te manquer la méthode this.setvisible(true); permettant d'afficher ta JFrame
    Dans quel niveau je dois la mettre cette méthode?

  5. #5
    Futur Membre du Club
    Profil pro
    Inscrit en
    Avril 2011
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2011
    Messages : 5
    Points : 5
    Points
    5
    Par défaut
    Bah sa dépend sa peut etre dans ton constructeur .
    Mais tu n'as pas de main non plus Oo.

    As-tu essayé de lire : http://baptiste-wicht.developpez.com...wing/debutant/

  6. #6
    Membre actif Avatar de pendoRa
    Homme Profil pro
    Ingénieur intégration
    Inscrit en
    Mai 2007
    Messages
    317
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur intégration
    Secteur : Industrie

    Informations forums :
    Inscription : Mai 2007
    Messages : 317
    Points : 278
    Points
    278
    Par défaut
    Je te conseil de lire la doc de nainnain6 ( enfin celle de dev.net ) et de revoir ton code !

    SInon essaye ceci : Classe Inter
    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
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.ComponentOrientation;
    import java.awt.Font;
    import java.awt.Rectangle;
     
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JToggleButton;
     
     
    public class Inter extends JFrame {
     
    	private static final long serialVersionUID = 1L;
     
    	private JPanel jContentPane = null;
     
     
     
    	private JButton entrée = null;
     
    	private JToggleButton jToggleButton = null;
     
    	private JLabel jLabel = null;
     
    	private JButton jButton = null;
     
    	public Inter() {
    		super();
    		initialisation();
     
    	}
     
     
    	public void initialisation() {
     
    		setTitle("Accueil Sonelgaz Aplication"); // aPPlication ! 
    		setSize(1046, 286);
    		setLocationRelativeTo(null);
    		setResizable(false);
    		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		setContentPane(buildContentPane());
    	}
     
    	public JPanel buildContentPane() {
    		if (jContentPane == null) {
    			jLabel = new JLabel();
    			jLabel.setBounds(new Rectangle(313, 18, 307, 32));
    			jLabel.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 24));
    			jLabel.setBackground(new Color(238, 238, 137));
    			jLabel.setForeground(new Color(51, 123, 51));
    			jLabel.setText("     Faite votre choix merci");
    			jContentPane = new JPanel();
    			jContentPane.setLayout(null);
    			jContentPane.setVisible(true);
    			jContentPane.setBackground(new Color(255, 225, 0));
    			jContentPane.add(getEntrée(), null);
    			jContentPane.add(getJToggleButton(), null);
    			jContentPane.add(jLabel, null);
    			jContentPane.add(getJButton(), null);
    		}
    		return jContentPane;
    	}
     
    	/**
             * This method initializes entrée      
             *      
             * @return javax.swing.JButton  
             */
    	private JButton getEntrée() {
    		if (entrée == null) {
    			entrée = new JButton();
    			entrée.setBounds(new Rectangle(384, 165, 190, 32));
    			entrée.setFont(new Font("Andalus", Font.BOLD | Font.ITALIC, 18));
    			entrée.setBackground(new Color(217, 150, 135));
    			entrée.setForeground(new Color(51, 51, 154));
    			entrée.setText("Liste des incidents");
    		}
    		return entrée;
    	}
     
     
    	private JToggleButton getJToggleButton() {
    		if (jToggleButton == null) {
    			jToggleButton = new JToggleButton();
     
    			jToggleButton.setBounds(new Rectangle(143, 102, 206, 36));
    			jToggleButton.setText("Saisie d'un incident");
    			jToggleButton.setFont(new Font("Andalus", Font.BOLD | Font.ITALIC, 18));
    			jToggleButton.setBackground(new Color(217, 150, 135));
    			jToggleButton.setComponentOrientation(ComponentOrientation.UNKNOWN);
    			jToggleButton.setForeground(new Color(51, 51, 154));
    			jToggleButton.setVisible(true);
    			jToggleButton.addActionListener(new java.awt.event.ActionListener() {
    				public void actionPerformed(java.awt.event.ActionEvent e) {
     
    					new Sortie1().setVisible(true); 
    					jToggleButton.setVisible(false); 
     
    					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
     
    				}
     
    			});
    			jToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
    				public void mouseClicked(java.awt.event.MouseEvent e) {
    					System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
    					new Sortie1().setVisible(true); 
    					jToggleButton.setVisible(false); 
    }
    			});
    		}
    		return jToggleButton;
    	}
     
     
    	private JButton getJButton() {
    		if (jButton == null) {
    			jButton = new JButton();
    			jButton.setBounds(new Rectangle(596, 103, 236, 31));
    			jButton.setFont(new Font("Andalus", Font.BOLD | Font.ITALIC, 18));
    			jButton.setBackground(new Color(217, 150, 135));
    			jButton.setForeground(new Color(51, 51, 154));
    			jButton.setText("Nombre d'incidents");
    		}
    		return jButton;
    	}
     
    }
    Classe Sortie1
    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
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    import java.awt.BorderLayout;
    import java.awt.Color;
     
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.Dimension;
    import javax.swing.JTextField;
    import java.awt.Rectangle;
    import javax.swing.JScrollBar;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JTextArea;
    import javax.swing.JComboBox;
    import javax.swing.JLabel;
    import javax.swing.JButton;
     
    public class Sortie1 extends JFrame {
     
    	private static final long serialVersionUID = 1L;
     
    	private JPanel jContentPane = null;
     
    	private JComboBox jComboBox = null;
     
    	private JLabel jLabel = null;
     
    	private JLabel jLabel1 = null;
     
    	private JComboBox jComboBox1 = null;
     
    	private JComboBox jComboBox2 = null;
     
    	private JComboBox jComboBox3 = null;
     
    	private JComboBox jComboBox4 = null;
     
    	private JLabel jLabel2 = null;
     
    	private JLabel jLabel3 = null;
     
    	private JLabel jLabel4 = null;
     
    	private JButton jButton = null;
     
     
    	public Sortie1() {
    		super();
    		initialize();
    	}
     
     
    	private void initialize() {
     
     
    		setSize(767, 324);
    		setContentPane(getJContentPane());
    		setTitle("Formulaire pour incident");
    		setVisible(true);
    	}
     
     
    	private JPanel getJContentPane() {
    		if (jContentPane == null) {
    			jLabel4 = new JLabel();
    			jLabel4.setBounds(new Rectangle(28, 175, 136, 28));
    			jLabel4.setText("JLabel");
    			jLabel3 = new JLabel();
    			jLabel3.setBounds(new Rectangle(26, 136, 137, 28));
    			jLabel3.setText("JLabel");
    			jLabel2 = new JLabel();
    			jLabel2.setBounds(new Rectangle(29, 90, 129, 34));
    			jLabel2.setText("JLabel");
    			jLabel1 = new JLabel();
    			jLabel1.setBounds(new Rectangle(30, 56, 131, 27));
    			jLabel1.setText("JLabel");
    			jLabel = new JLabel();
    			jLabel.setBounds(new Rectangle(31, 14, 134, 30));
    			jLabel.setText("JLabel");
    			jContentPane = new JPanel();
    			jContentPane.setLayout(null);
    			jContentPane.add(getJComboBox(), null);
    			jContentPane.add(jLabel, null);
    			jContentPane.add(jLabel1, null);
    			jContentPane.add(getJComboBox1(), null);
    			jContentPane.add(getJComboBox2(), null);
    			jContentPane.add(getJComboBox3(), null);
    			jContentPane.add(getJComboBox4(), null);
    			jContentPane.add(jLabel2, null);
    			jContentPane.add(jLabel3, null);
    			jContentPane.add(jLabel4, null);
    			jContentPane.add(getJButton(), null);
     
    		}
    		return jContentPane;
    	}
     
     
    	private JComboBox getJComboBox() {
    		if (jComboBox == null) {
    			jComboBox = new JComboBox();
    			jComboBox.setBounds(new Rectangle(187, 15, 187, 30));
    		}
    		return jComboBox;
    	}
     
     
    	private JComboBox getJComboBox1() {
    		if (jComboBox1 == null) {
    			jComboBox1 = new JComboBox();
    			jComboBox1.setBounds(new Rectangle(184, 56, 189, 30));
    		}
    		return jComboBox1;
    	}
     
     
    	private JComboBox getJComboBox2() {
    		if (jComboBox2 == null) {
    			jComboBox2 = new JComboBox();
    			jComboBox2.setBounds(new Rectangle(184, 92, 188, 31));
    		}
    		return jComboBox2;
    	}
     
     
    	private JComboBox getJComboBox3() {
    		if (jComboBox3 == null) {
    			jComboBox3 = new JComboBox();
    			jComboBox3.setBounds(new Rectangle(185, 138, 188, 27));
    		}
    		return jComboBox3;
    	}
     
    	private JComboBox getJComboBox4() {
    		if (jComboBox4 == null) {
    			jComboBox4 = new JComboBox();
    			jComboBox4.setBounds(new Rectangle(182, 178, 192, 28));
    		}
    		return jComboBox4;
    	}
     
     
    	private JButton getJButton() {
    		if (jButton == null) {
    			jButton = new JButton();
    			jButton.setBounds(new Rectangle(336, 260, 110, 27));
    			jButton.setText("Entré");
    		}
    		return jButton;
    	}
     
    }
    Le Main :
    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
    import javax.swing.SwingUtilities;
     
    public class Main {
    	/*
    	 *
    	 * CLASSE MAIN
    	 * 
    	 * @param args
    	 */
    	public static void main(String[] args){
    		SwingUtilities.invokeLater(new Runnable(){
     
    			public void run(){
     
     
    				Inter constructeur = new Inter();
     
    				constructeur.setVisible(true);
     
    			}
     
    		});
     
    	}
     
    }
    ps : Fais gaffe aux fautes aussi !
    ps2 : c'est bien parce que tu as Gally en avatar

  7. #7
    Membre à l'essai
    Inscrit en
    Avril 2011
    Messages
    11
    Détails du profil
    Informations forums :
    Inscription : Avril 2011
    Messages : 11
    Points : 11
    Points
    11
    Par défaut
    Un conseil ne mets pas d'accentuation dans tes noms de méthodes.

Discussions similaires

  1. mon while fonctionne pas comme je veux
    Par domxaline dans le forum Débuter avec Java
    Réponses: 7
    Dernier message: 02/06/2015, 16h09
  2. Mon filtre automatique ne fonctionne pas comme je veux
    Par La Zélie dans le forum Macros et VBA Excel
    Réponses: 5
    Dernier message: 19/11/2008, 17h32
  3. Mon programme ne fonctionne pas.
    Par Apprenti Pythonien dans le forum Général Python
    Réponses: 9
    Dernier message: 13/06/2008, 18h10
  4. Mon programme ne fonctionne pas
    Par phil23 dans le forum C
    Réponses: 4
    Dernier message: 22/03/2007, 16h31
  5. un if qui ne fonctionne pas comme je veux
    Par Kelly182 dans le forum Access
    Réponses: 4
    Dernier message: 27/07/2006, 15h12

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo