/** Initializes the applet ApplClient */
public void init() {
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
/** This method is called from within the init() method 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">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
Groupe3 = new javax.swing.JRadioButton();
okGroupe3 = new javax.swing.JButton();
jComboBox1 = new javax.swing.JComboBox();
dvoraky
Messages postés744Date d'inscriptiondimanche 1 avril 2007StatutMembreDernière intervention 9 mai 20108 25 nov. 2008 à 10:13
Salut,
Je sais pas si le code mis comme ça aide à mieux comprendre...
<hr width="100%" size="2" />
C'est après des heures de codage que j'ai compris pourquoi les créateurs de Java ont choisi une tasse de café comme logo...
dvoraky
Messages postés744Date d'inscriptiondimanche 1 avril 2007StatutMembreDernière intervention 9 mai 20108 26 nov. 2008 à 09:02
Bon arrêtes de mettre ton code comme ça c'est illisible et ça donne pas envi de répondre....
As tu bien référencé ta servlet dans ton web.xml???
<hr width="100%" size="2" />
C'est après des heures de codage que j'ai compris pourquoi les créateurs de Java ont choisi une tasse de café comme logo...
/*
* test1.java
*
* Created on 20 novembre 2008, 10:42
*/
import java.util.Vector;
/**HEDAHDIA/
* Suite a la projet WebApplication4.
* On utilise cette Applet pour testter la communication avec la servlet on
* utlisant les composants SWING
*
*/
public class test2 extends javax.swing.JApplet {
/** This method is called from within the init() method 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">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jComboBox1 = new javax.swing.JComboBox();
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
int i;
try
{
URLConnection con1=getServletConnection();
// get input data for sending
Vector Tab1 = new Vector();
for (i=1;i < 5;i++){
String input = jTextField1.getText() ;
Tab1.addElement(input);
}
// send data to the servlet
sendObject(con1,Tab1);
// receive result from servlet
Vector Res =new Vector();
Res =(Vector)receiveObject(con1);