Example #1
0
 private void jButton1ActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton1ActionPerformed
   JFileChooser fileChooser = new JFileChooser();
   int retour = fileChooser.showOpenDialog(this);
   if (retour == JFileChooser.APPROVE_OPTION) {
     File file = fileChooser.getSelectedFile();
     message.addPieceJointes(file.getName(), file);
     GpieceJointe.setText(String.valueOf(message.getNbPieceJointes()));
   }
 } // GEN-LAST:event_jButton1ActionPerformed
Example #2
0
 private void jButton3ActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton3ActionPerformed
   String from = Gfrom.getText();
   String to = Gto.getText();
   String sujet = Gsujet.getText();
   String msg = Gmessage.getText();
   if (from.isEmpty()) {
     JOptionPane.showMessageDialog(this, "Le destinateur n'est pas valide");
   }
   if (to.isEmpty()) {
     JOptionPane.showMessageDialog(this, "Le destinataire n'est pas valide");
   }
   if (sujet.isEmpty()) {
     JOptionPane.showMessageDialog(this, "Le sujet n'est pas valide");
   }
   message.setFrom(from);
   message.setTo(to);
   message.setSujet(sujet);
   message.setMessage(msg);
   Reception reception = new Reception(parent, true, message);
   reception.setVisible(true);
 } // GEN-LAST:event_jButton3ActionPerformed