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
|
Conexion c=new Conexion(); // <-- on sait pas ce qui se passe là dedans
c.Qouery("jdbc:mysql://localhost/mabase", "root","","SELECT * FROM test");
// on sait pas ce qui se passe là dedans
// en plus il y a quoi dans cette table?
try{
String []titre={"id","nom", "prenom", "sexe", "password","login"};
System.out.println();
/** Etape 5: utilisation du résultat */
// il se passe quoi là dedans ---v
String [][]data=new String[c.getVariable1()][6];
while( c.getResultat1().next() ) {
// ^-- on sais pas ce qui se passe là dedans
// Dans tous les cas, tu va créer un set de composants graphiques par résultat, mais comme on ignore ce que tu en fait après
for(int j = 0; j <2 ; j++){
for(int i=0;i<c.getVariable1();i++){
// on sais toujours pas ce qui se passe là dedans --^
data[j][i]=c.getResultat1().getString(i+1);
// Je me demande vraiment ce qu'il y a la dedans --^
}}
JTable tableau = new JTable(data,titre);
tableau.setBackground(Color.decode("#FCE1AB"));
JScrollPane scp=new JScrollPane(tableau); // JScrollpane barre de defilement
scp.setBackground(Color.decode("#FCE1AB"));
JFrame jf=new JFrame();
jf.setSize(500,400);
jf.setBackground(Color.decode("#FCE1AB"));
Container cont= jf.getContentPane();
cont.setLayout(new FlowLayout());
cont.add(scp); |
Partager