Probleme fenetre java
djoufouf
Messages postés
9
Date d'inscription
Statut
Membre
Dernière intervention
-
KX Messages postés 16761 Date d'inscription Statut Modérateur Dernière intervention -
KX Messages postés 16761 Date d'inscription Statut Modérateur Dernière intervention -
bonjour j ai un probleme ma fenetre ne s ouvre pas ! voici mon script
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fenetre;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
*
* @author Weymeels
*/
public class Fenetre extends JFrame implements ActionListener
{
private String mot;
private JButton affiche, efface;
private JLabel affichage;
private JPanel pano;
//consturcteur de la classe
public Fenetre()
{
setSize(300, 100);
setTitle ("boutons");
setDefaultCloseOperation(EXIT_ON_CLOSE);
pano = new JPanel (new BorderLayout(40, 50));
affiche = new JButton("affiché");
efface = new JButton ("effacé");
affiche.addActionListener(this);
efface.addActionListener(this);
affichage = new JLabel ();
pano.add(efface, BorderLayout.EAST);
pano.add(affiche, BorderLayout.WEST);
add(pano);
setvisible(true);
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
@Override
public void actionPerformed(ActionEvent ae) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
private void setvisible(boolean b) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
et voici ce qu il me disent
run:
BUILD SUCCESSFUL (total time: 0 seconds)
je comprend pas aidé svp
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fenetre;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
*
* @author Weymeels
*/
public class Fenetre extends JFrame implements ActionListener
{
private String mot;
private JButton affiche, efface;
private JLabel affichage;
private JPanel pano;
//consturcteur de la classe
public Fenetre()
{
setSize(300, 100);
setTitle ("boutons");
setDefaultCloseOperation(EXIT_ON_CLOSE);
pano = new JPanel (new BorderLayout(40, 50));
affiche = new JButton("affiché");
efface = new JButton ("effacé");
affiche.addActionListener(this);
efface.addActionListener(this);
affichage = new JLabel ();
pano.add(efface, BorderLayout.EAST);
pano.add(affiche, BorderLayout.WEST);
add(pano);
setvisible(true);
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
@Override
public void actionPerformed(ActionEvent ae) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
private void setvisible(boolean b) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
et voici ce qu il me disent
run:
BUILD SUCCESSFUL (total time: 0 seconds)
je comprend pas aidé svp
A voir également:
- Probleme fenetre java
- Waptrick java football - Télécharger - Jeux vidéo
- Jeux java itel - Télécharger - Jeux vidéo
- Eclipse java - Télécharger - Langages
- Java apk - Télécharger - Langages
- Waptrick java voiture - Télécharger - Jeux vidéo
1 réponse
public static void main(String[] args) { // TODO code application logic here }
Il faut mettre quelque chose dans ton main, sinon ton programme ne fait rien !
private void setvisible(boolean b) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
Quelle idée saugrenue de vouloir générer une exception sur un setvisible !
Tout cela sent NetBeans à plein nez ! Avant d'utiliser des outils trop compliqués pour toi, apprends à programmer manuellement...