bsmaiga
Messages postés2Date d'inscriptionjeudi 23 septembre 2010StatutMembreDernière intervention11 janvier 2011 11 janv. 2011 à 13:19
bonjour Laurent1024
oui je crois que ta raison en faites voici le codes source de mon programme. le programme s'exécute correctement, et les informations taper sont directement transféré dans un fiche word. Et ce que je voulais c'était de mettre ces information dans un tableau.
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class AppliSaisie {
public static void main(String[]args) {
FicheSaisie fen = new FicheSaisie();
fen.setBounds(300,300,500,450);
fen.setVisible(true);
}
}
@SuppressWarnings("serial")
class FicheSaisie extends Frame{
Button bout1 = new Button();
Label label1 = new Label();
Label label2 = new Label();
Label label3 = new Label();
Label label4 = new Label();
TextField text1 = new TextField();
TextField text2 = new TextField();
TextField text3 = new TextField();
TextField text4 = new TextField();
TextField text5 = new TextField();
TextField text6 = new TextField();
CheckboxGroup checkboxgoup = new CheckboxGroup();
Checkbox group1 = new Checkbox();
Checkbox group2 = new Checkbox();
Checkbox group3 = new Checkbox();
EtatCivil = " ";
try{
fluxwrite = new FileWriter("Etudiant.xls", true);
fluxout = new BufferedWriter(fluxwrite);
}
catch(IOException err){
System.out.println( "Problème dans l'ouverture du fichier ");
}
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
try{
fluxout.close();
}
catch(IOException err){
System.out.println("Impossible de fermer le fiche");
}
System.exit(100);
}
});
text1.addTextListener(new TextListener(){
public void textValueChanged(TextEvent e){
AutoriserSave();
}
});
text2.addTextListener(new TextListener(){
public void textValueChanged(TextEvent e){
AutoriserSave();
}
});
text3.addTextListener(new TextListener(){
public void textValueChanged(TextEvent e){
AutoriserSave();
}
});
text4.addTextListener(new TextListener(){
public void textValueChanged(TextEvent e){
AutoriserSave();
}
});
text5.addTextListener(new TextListener(){
public void textValueChanged(TextEvent e){
AutoriserSave();
}
});
text6.addTextListener(new TextListener(){
public void textValueChanged(TextEvent e){
AutoriserSave();
}
});
group1.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e){
StoreEtatCivil();
}
});
group2.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e){
StoreEtatCivil();
}
});
group3.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e){
StoreEtatCivil();
}
});
bout1.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e){
ecrireEnreg(EtatCivil+": "+text2.getText()+" "+text1.getText()+" "+text3.getText()+" "+text4.getText()+" "+text5.getText()+" "+text6.getText());
}
});
}
}
import java.awt.*;
import java.awt.event.*;
public class InscriptionBSM {
public static void main(String[]args){
Inscription fen = new Inscription();
fen.setBounds(350,350,400,350);
fen.setVisible(true);
}
}
@SuppressWarnings("serial")
class Inscription extends Frame{
Button bout1 = new Button();
Label label1 = new Label();
TextField text = new TextField();
CheckboxGroup checkboxgroup = new CheckboxGroup();
Checkbox group1 = new Checkbox();
Checkbox group2 = new Checkbox();
Checkbox group3 = new Checkbox();