[DEBUTANTE] Comment afficher une hashtable dans une fenêtre
Salut à tous,
je travaille avec ecllipse 3.1 dans lequel je n'ai pas pu utilisé des map alors j'ai utilisé des hashtable.
Mais pour moi ihm, je ne sais pas comment afficher mon hashtable dans une fenêtre avec les noms des colonnes. est ce que vous pouvez m'aider?
voici le code que j'ai fait:
Code:
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
| public static Hashtable nbTotalDispo() throws Exception
{
//Recuperation liste des profs
ArrayList nomProf ;
Mysql m=new Mysql();
m.Connect("Services");
nomProf = m.NomProf();
//Recuperation info LDAP
ldap olda = new ldap( "", "" ) ;
olda.connectldap();
Hashtable t = new Hashtable() ;
t = InfoLdap(olda, nomProf ) ;
olda.deconnectldap();
//Recuperation info MySQL
Hashtable s = new Hashtable();
s = Info( m, nomProf, t ) ;
m.Deconnect() ;
for( int i = 0 ; i < nomProf.size() ; i++)
{
Prof htemp =
(Prof) s.get( nomProf.get(i).toString() ) ;
float nbTotal = ( (( htemp.nbC + htemp.nbS ) * (float)(htemp.quotite/100.0) ) - htemp.nbE ) ;
((Prof) s.get( nomProf.get(i).toString() )).nbDispo = nbTotal ;
}
Hashtable stat = new Hashtable();
return stat;
}
private void initComponents() {//GEN-BEGIN:initComponents
JPanel jPanel1 = new javax.swing.JPanel();
getContentPane().setLayout(null);
setTitle("Nombre Total D'heures Diponibles");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
});
jPanel1.setLayout(null);
getContentPane().add(jPanel1);
jPanel1.setBounds(0, 0, 400, 280);
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-374)/2, (screenSize.height-232)/2, 374, 232);
}//GEN-END:initComponents
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
System.exit(0);
}//GEN-LAST:event_exitForm |
Mais j'ai pas la fenêtre avec la hashtable
Aidez moi svp et n'hésitez pas à toucher au code. ;)
Merci d'avance.