Java.application
Fermé
chafchoufa
Messages postés
10
Date d'inscription
jeudi 11 mai 2017
Statut
Membre
Dernière intervention
11 mai 2017
-
11 mai 2017 à 01:31
chafchoufa Messages postés 10 Date d'inscription jeudi 11 mai 2017 Statut Membre Dernière intervention 11 mai 2017 - 11 mai 2017 à 03:15
chafchoufa Messages postés 10 Date d'inscription jeudi 11 mai 2017 Statut Membre Dernière intervention 11 mai 2017 - 11 mai 2017 à 03:15
3 réponses
Felice_
Messages postés
265
Date d'inscription
mardi 25 avril 2017
Statut
Membre
Dernière intervention
20 juillet 2017
11
11 mai 2017 à 02:23
11 mai 2017 à 02:23
Je vois pas ton code… Le graphique en Java ce fait avec la bibliothèque Swing.
chafchoufa
Messages postés
10
Date d'inscription
jeudi 11 mai 2017
Statut
Membre
Dernière intervention
11 mai 2017
Modifié le 11 mai 2017 à 06:59
Modifié le 11 mai 2017 à 06:59
import java.sql.ResultSet; import java.sql.Statement; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; /** * * @author PRINCE CHAHAD */ public class Gestion_des_notes extends javax.swing.JFrame { /** * Creates new form Gestion_des_notes */ Connecter conn = new Connecter(); Statement stm; ResultSet Rs; DefaultTableModel model = new DefaultTableModel(); public Gestion_des_notes() { initComponents(); model.addColumn("Matricule"); model.addColumn("Nom"); model.addColumn("Prenom"); model.addColumn("Sexe"); model.addColumn("Lieu_de_Naissance"); model.addColumn("Pays"); model.addColumn("ville"); model.addColumn("Faculte"); model.addColumn("Departement"); model.addColumn("Filiere"); model.addColumn("Niveau"); try { stm = conn.ObtenirConnection().createStatement(); ResultSet Rs = stm.executeQuery("Select * from marzoukh"); while (Rs.next()) { model.addRow(new Object[]{Rs.getString("Matricule"), Rs.getString("Nom"), Rs.getString("Prenom"), Rs.getString("Sexe"), Rs.getString("Lieu_de_Naissance"), Rs.getString("Pays"), Rs.getString("ville"), Rs.getString("Faculte"), Rs.getString("Departement"), Rs.getString("Filiere"), Rs.getString("Niveau")}); } } catch (Exception e) { System.err.println(e); } tble.setModel(model); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); txtli = new javax.swing.JTextField(); txtni = new javax.swing.JTextField(); txtma = new javax.swing.JTextField(); txtpr = new javax.swing.JTextField(); txtpa = new javax.swing.JTextField(); txtvi = new javax.swing.JTextField(); txtde = new javax.swing.JTextField(); txtno = new javax.swing.JTextField(); txtse2 = new javax.swing.JRadioButton(); txtse = new javax.swing.JRadioButton(); jScrollPane2 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); txtfi = new javax.swing.JComboBox(); txtfa = new javax.swing.JComboBox(); jPanel3 = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); tble = new javax.swing.JTable(); jButton2 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); txtre = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenu3 = new javax.swing.JMenu(); jMenu4 = new javax.swing.JMenu(); jMenu5 = new javax.swing.JMenu(); jMenu2 = new javax.swing.JMenu(); jMenu6 = new javax.swing.JMenu(); jTextField1.setText("jTextField1"); jTextField2.setText("jTextField2"); jTextField3.setText("jTextField3"); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(null); jPanel1.setLayout(null); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel1.setText("Matricule:"); jPanel1.add(jLabel1); jLabel1.setBounds(10, 21, 72, 17); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel3.setText("Nom:"); jPanel1.add(jLabel3); jLabel3.setBounds(10, 50, 72, 17); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel4.setText("ville:"); jPanel1.add(jLabel4); jLabel4.setBounds(30, 250, 70, 17); jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel5.setText("Faculte:"); jPanel1.add(jLabel5); jLabel5.setBounds(10, 280, 72, 17); jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel6.setText("Departement:"); jPanel1.add(jLabel6); jLabel6.setBounds(10, 310, 96, 17); jLabel7.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel7.setText("Filiere:"); jPanel1.add(jLabel7); jLabel7.setBounds(20, 360, 72, 17); jLabel8.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel8.setText("Niveau:"); jPanel1.add(jLabel8); jLabel8.setBounds(10, 390, 72, 17); jLabel9.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel9.setText("Sexe:"); jPanel1.add(jLabel9); jLabel9.setBounds(10, 130, 72, 17); jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel11.setText("Prenom:"); jPanel1.add(jLabel11); jLabel11.setBounds(10, 90, 72, 17); jLabel12.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel12.setText("Lieu_de_Naissance:"); jPanel1.add(jLabel12); jLabel12.setBounds(10, 170, 140, 17); jLabel13.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel13.setText("Pays:"); jPanel1.add(jLabel13); jLabel13.setBounds(20, 220, 72, 17); txtli.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtli.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtliActionPerformed(evt); } }); jPanel1.add(txtli); txtli.setBounds(210, 160, 130, 30); txtni.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtni.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtniActionPerformed(evt); } }); jPanel1.add(txtni); txtni.setBounds(210, 380, 130, 30); txtma.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtma.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtmaActionPerformed(evt); } }); jPanel1.add(txtma); txtma.setBounds(210, 13, 130, 30); txtpr.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtpr.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtprActionPerformed(evt); } }); jPanel1.add(txtpr); txtpr.setBounds(210, 83, 130, 30); txtpa.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtpa.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtpaActionPerformed(evt); } }); jPanel1.add(txtpa); txtpa.setBounds(210, 200, 130, 30); txtvi.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtvi.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtviActionPerformed(evt); } }); jPanel1.add(txtvi); txtvi.setBounds(210, 233, 130, 30); txtde.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtde.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtdeActionPerformed(evt); } }); jPanel1.add(txtde); txtde.setBounds(210, 310, 130, 30); txtno.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtno.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtnoActionPerformed(evt); } }); jPanel1.add(txtno); txtno.setBounds(210, 50, 130, 30); txtse2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtse2.setText("F"); txtse2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtse2ActionPerformed(evt); } }); jPanel1.add(txtse2); txtse2.setBounds(310, 120, 40, 30); txtse.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtse.setText("M"); jPanel1.add(txtse); txtse.setBounds(210, 120, 37, 30); jTable2.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); jScrollPane2.setViewportView(jTable2); jPanel1.add(jScrollPane2); jScrollPane2.setBounds(460, 0, 420, 520); txtfi.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtfi.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "MA", "AR", "BIOLOGIE", "GEOLOGIE", "HISTOIRE", " " })); txtfi.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtfiActionPerformed(evt); } }); jPanel1.add(txtfi); txtfi.setBounds(211, 343, 130, 30); txtfa.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N txtfa.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "FSGP", "FALSH", "FS", "UIT", " " })); jPanel1.add(txtfa); txtfa.setBounds(210, 270, 130, 30); getContentPane().add(jPanel1); jPanel1.setBounds(0, 80, 350, 420); tble.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6", "Title 7", "Title 8", "Title 9", "Title 10", "Title 11", "Title 12" } )); tble.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { tbleMouseClicked(evt); } }); jScrollPane3.setViewportView(tble); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(18, 18, 18) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 685, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(27, Short.MAX_VALUE)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 414, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); getContentPane().add(jPanel3); jPanel3.setBounds(370, 80, 730, 420); jButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton2.setText("Actualiser"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); getContentPane().add(jButton2); jButton2.setBounds(223, 560, 100, 40); jButton4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton4.setText("Ajouter"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); getContentPane().add(jButton4); jButton4.setBounds(230, 510, 85, 30); jButton5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton5.setText("Modifier"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); getContentPane().add(jButton5); jButton5.setBounds(350, 500, 100, 40); jButton6.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton6.setText("Recherche"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); getContentPane().add(jButton6); jButton6.setBounds(520, 560, 120, 40); jButton7.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton7.setText("Supprimer"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); getContentPane().add(jButton7); jButton7.setBounds(350, 560, 105, 40); txtre.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtreActionPerformed(evt); } }); getContentPane().add(txtre); txtre.setBounds(750, 570, 130, 30); jLabel2.setFont(new java.awt.Font("Bodoni MT Black", 1, 24)); // NOI18N jLabel2.setText("GESTION DES ETUDIANTS"); getContentPane().add(jLabel2); jLabel2.setBounds(340, 10, 400, 60); jButton3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton3.setText("Quitter"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); getContentPane().add(jButton3); jButton3.setBounds(520, 500, 120, 40); jButton1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton1.setText("Realiser par"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addGap(0, 10, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) ); getContentPane().add(jPanel2); jPanel2.setBounds(740, 500, 140, 50); jMenu1.setText("File"); jMenu3.setText("Ajouter"); jMenu1.add(jMenu3); jMenu4.setText("Modifier"); jMenu1.add(jMenu4); jMenu5.setText("Actialiser"); jMenu1.add(jMenu5); jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenu6.setText("Rechercher"); jMenu2.add(jMenu6); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); pack(); }// </editor-fold> private void deplace(int i) { try { txtma.setText(model.getValueAt(i, 0).toString()); txtno.setText(model.getValueAt(i, 1).toString()); txtpr.setText(model.getValueAt(i, 2).toString()); txtse.setText(model.getValueAt(i, 3).toString()); txtli.setText(model.getValueAt(i, 4).toString()); txtpa.setText(model.getValueAt(i, 5).toString()); txtvi.setText(model.getValueAt(i, 6).toString()); txtfa.setSelectedItem(model.getValueAt(i, 7).toString()); txtde.setText(model.getValueAt(i, 8).toString()); txtfi.setSelectedItem(model.getValueAt(i, 9).toString()); txtni.setText(model.getValueAt(i, 10).toString()); } catch (Exception e) { System.err.println(e); JOptionPane.showMessageDialog(null, "Erreur de deplacement" + e.getLocalizedMessage()); } } private void txtniActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void txtmaActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void txtprActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void txtviActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void txtdeActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void txtnoActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void txtpaActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void txtse2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { String matricule = txtma.getText(); String nom = txtno.getText(); String prenom = txtpr.getText(); String sexe = txtse.getText(); String lieu_de_naissance = txtli.getText(); String pays = txtpa.getText(); String ville = txtvi.getText(); String faculte = txtfa.getSelectedItem().toString(); String departement = txtde.getText(); String filiere = txtfi.getSelectedItem().toString(); String niveau = txtni.getText(); String requete = "insert into marzoukh(Matricule,Nom,Prenom,Sexe,Lieu_de_Naissance,Pays,ville,Faculte,Departement,Filiere,Niveau)VALUES('" + matricule + "','" + nom + "','" + prenom + "','" + sexe + "','" + lieu_de_naissance + "','" + pays + "','" + ville + "','" + faculte + "','" + departement + "','" + filiere + "','" + niveau + "')"; try { stm.executeUpdate(requete); JOptionPane.showMessageDialog(null, "L'etudiant est bien ajouter"); txtma.setText(""); txtno.setText(""); txtpr.setText(""); txtse.setText(""); txtli.setText(""); txtpa.setText(""); txtvi.setText(""); txtde.setText(""); txtfi.setSelectedItem("2"); txtni.setText(""); txtfa.setSelectedItem(1); } catch (Exception ex) { JOptionPane.showMessageDialog(null, ex.getMessage()); } } private void txtfiActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void tbleMouseClicked(java.awt.event.MouseEvent evt) { // TODO add your handling code here: try { int i = tble.getSelectedRow(); deplace(i); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Erreur de deplacement " + e.getLocalizedMessage()); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { try { model.setRowCount(0); stm = conn.ObtenirConnection().createStatement(); ResultSet rs = stm.executeQuery("Select*from marzoukh"); while (rs.next()) { model.addRow(new Object[]{rs.getString("Matricule"), rs.getString("Nom"), rs.getString("Prenom"), rs.getString("Sexe"), rs.getString("Lieu_de_Naissance"), rs.getString("Pays"), rs.getString("ville"), rs.getString("Faculte"), rs.getString("Departement"), rs.getString("Filiere"), rs.getString("Niveau")}); } } catch (Exception e) { System.err.println(e); } tble.setModel(model); } private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) { try { if (JOptionPane.showConfirmDialog(null, "Attention vous avez supprimer un Etudiant,Est ce que tu est sure?", "Supprimer Etudiant", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION) { if (txtma.getText().length() != 0) { stm.executeUpdate("Delete From marzoukh WHERE Matricule ='" + txtma.getText() + "'"); } else { JOptionPane.showMessageDialog(null, "Veuillez remplire le champ Maticule SVP!"); } } } catch (Exception e) { JOptionPane.showMessageDialog(null, "Erreur de Suppression\n" + e.getMessage()); } } private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) { try { if (JOptionPane.showConfirmDialog(null, "confirmer la modification", "modification", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION) { stm.executeUpdate("UPDATE marzoukh SET Nom='" + txtno.getText() + "',Prenom='" + txtpr.getText() + "',Sexe='" + txtse.getText() + "',Lieu_de_Naissance='" + txtli.getText() + "',Pays='" + txtpa.getText() + "',ville='" + txtvi.getText() + "',Departement='" + txtde.getText() + "',Filiere='" + txtfi.getSelectedItem().toString() + "',Faculte='" + txtfa.getSelectedItem().toString() + "' WHERE Matricule='" + txtma.getText() + "'"); } } catch (Exception e) { JOptionPane.showMessageDialog(null, "Erreur de modification !!!!!!!"); System.err.println(e); } } private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) { try { model.setRowCount(0); { Rs = stm.executeQuery("Select *From marzoukh WHERE Matricule='" + txtre.getText() + "'"); } while (Rs.next()) { Object[] Etudiant = {Rs.getString(1), Rs.getString(2), Rs.getString(3), Rs.getString(4), Rs.getString(5), Rs.getString(6), Rs.getString(7), Rs.getString(8), Rs.getString(9), Rs.getString(10), Rs.getString(11)}; model.addRow(Etudiant); } if (model.getRowCount() == 0) { JOptionPane.showMessageDialog(null, "cette matricule n'existe pas"); } else { int i = 0; deplace(i); } } catch (Exception e) { System.err.println(e); JOptionPane.showMessageDialog(null, e.getMessage()); } } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { Realiser a =new Realiser(); a.setVisible(true); } private void txtliActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void txtreActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: char caract = 'a'; caract = (char)((int)caract-32); System.out.println("a -> " + caract); } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: System.exit(0); } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see [http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html] */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Gestion_des_notes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Gestion_des_notes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Gestion_des_notes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Gestion_des_notes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Gestion_des_notes().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenu jMenu5; private javax.swing.JMenu jMenu6; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JTable jTable2; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTable tble; private javax.swing.JTextField txtde; private javax.swing.JComboBox txtfa; private javax.swing.JComboBox txtfi; private javax.swing.JTextField txtli; private javax.swing.JTextField txtma; private javax.swing.JTextField txtni; private javax.swing.JTextField txtno; private javax.swing.JTextField txtpa; private javax.swing.JTextField txtpr; private javax.swing.JTextField txtre; private javax.swing.JRadioButton txtse; private javax.swing.JRadioButton txtse2; private javax.swing.JTextField txtvi; // End of variables declaration private static class Statemement { public Statemement() { } } }
chafchoufa
Messages postés
10
Date d'inscription
jeudi 11 mai 2017
Statut
Membre
Dernière intervention
11 mai 2017
11 mai 2017 à 03:15
11 mai 2017 à 03:15
tu peutm'aider a ajouter une bouton qui peut lister les etudiants de meme promotion ?