Salut je fait un apllication java qui envoyer un message avec CKEditor :
voile le code :

SendEmail.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
 
/*
 * EmailSender2.java
 *
 * Created on 2010-04-14, 20:31:07
 */
 
package EmailSender;
 
import chrriis.common.UIUtils;
import chrriis.dj.nativeswing.swtimpl.NativeInterface;
import chrriis.dj.nativeswing.swtimpl.components.JHTMLEditor;
import chrriis.dj.nativeswing.swtimpl.components.JHTMLEditor.HTMLEditorImplementation;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.StringTokenizer;
 
/**
 *
 * @author Robert
 */
public class SendEmail extends javax.swing.JFrame {
 
    /** Creates new form EmailSender2 */
    public SendEmail() {
        initComponents();
    }
 
    /** 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() {
 
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        smtpServer = new javax.swing.JTextField();
        port = new javax.swing.JTextField();
        username = new javax.swing.JTextField();
        from = new javax.swing.JTextField();
        to = new javax.swing.JTextField();
        subject = new javax.swing.JTextField();
        password = new javax.swing.JPasswordField();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        sendEmail = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
 
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("JEmail Client with FCKEditor");
 
        jPanel1.setPreferredSize(new java.awt.Dimension(468, 150));
        jPanel1.setLayout(null);
 
        jLabel1.setText("Serwer smtp:");
        jPanel1.add(jLabel1);
        jLabel1.setBounds(10, 14, 64, 14);
 
        jLabel3.setText("Port:");
        jPanel1.add(jLabel3);
        jLabel3.setBounds(180, 10, 24, 20);
 
        jLabel2.setText("Użytkownik:");
        jPanel1.add(jLabel2);
        jLabel2.setBounds(10, 40, 58, 14);
 
        jLabel4.setText("Hasło:");
        jPanel1.add(jLabel4);
        jLabel4.setBounds(183, 71, 31, 14);
 
        jLabel5.setText("Twoj email:");
        jPanel1.add(jLabel5);
        jLabel5.setBounds(10, 71, 54, 14);
 
        jLabel6.setText("Do kogo:");
        jPanel1.add(jLabel6);
        jLabel6.setBounds(10, 97, 43, 14);
 
        jLabel7.setText("Temat:");
        jPanel1.add(jLabel7);
        jLabel7.setBounds(10, 128, 34, 14);
 
        smtpServer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                smtpServerActionPerformed(evt);
            }
        });
        jPanel1.add(smtpServer);
        smtpServer.setBounds(92, 11, 80, 20);
        jPanel1.add(port);
        port.setBounds(220, 10, 40, 20);
        jPanel1.add(username);
        username.setBounds(92, 37, 80, 20);
 
        from.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fromActionPerformed(evt);
            }
        });
        jPanel1.add(from);
        from.setBounds(93, 68, 80, 20);
        jPanel1.add(to);
        to.setBounds(93, 94, 325, 20);
        jPanel1.add(subject);
        subject.setBounds(93, 125, 325, 20);
 
        password.setPreferredSize(new java.awt.Dimension(100, 20));
        jPanel1.add(password);
        password.setBounds(220, 70, 200, 20);
 
        getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);
 
        jPanel2.setLayout(new java.awt.BorderLayout());
 
        sendEmail.setText("Wyślij");
        sendEmail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sendEmailActionPerformed(evt);
            }
        });
 
        jButton2.setText("Zamknij");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
 
        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(sendEmail)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton2)
                .addContainerGap(319, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(sendEmail)
                    .addComponent(jButton2))
                .addContainerGap(19, Short.MAX_VALUE))
        );
 
        jPanel2.add(jPanel3, java.awt.BorderLayout.SOUTH);
 
        getContentPane().add(jPanel2, java.awt.BorderLayout.PAGE_END);
 
        pack();
    }// </editor-fold>                        
 
    private void smtpServerActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
}                                          
 
    private void fromActionPerformed(java.awt.event.ActionEvent evt) {                                     
        // TODO add your handling code here:
}                                    
 
    private void sendEmailActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
                StringTokenizer recepientsTokenizer = new StringTokenizer(to.getText(), ",");
                final String[] recipientsString = new String[recepientsTokenizer.countTokens()];
                for (int i = 0; i < recipientsString.length; i++) {
                    recipientsString[i] = recepientsTokenizer.nextToken();
                }
                 final EmailSender emailer = new EmailSender(smtpServer.getText(),
                        port.getText(), username.getText(),
                        password.getPassword().toString(),
                        "true", from.getText());
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                emailer.sendEmail(subject.getText(),
                        htmlEditor.getHTMLContent(),
                        recipientsString);
            }
        });
 
    }                                         
 
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        dispose();
    }                                        
 
    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    UIUtils.setPreferredLookAndFeel();
    NativeInterface.open();
    final String configurationScript =
      "FCKConfig.ToolbarSets[\"Default\"] = [\n" +
      "[&apos;Source&apos;,&apos;DocProps&apos;,&apos;-&apos;,&apos;Save&apos;,&apos;NewPage&apos;,&apos;Preview&apos;,&apos;-&apos;,&apos;Templates&apos;],\n" +
      "[&apos;Cut&apos;,&apos;Copy&apos;,&apos;Paste&apos;,&apos;PasteText&apos;,&apos;PasteWord&apos;,&apos;-&apos;,&apos;Print&apos;,&apos;SpellCheck&apos;],\n" +
      "[&apos;Undo&apos;,&apos;Redo&apos;,&apos;-&apos;,&apos;Find&apos;,&apos;Replace&apos;,&apos;-&apos;,&apos;SelectAll&apos;,&apos;RemoveFormat&apos;],\n" +
      "[&apos;Form&apos;,&apos;Checkbox&apos;,&apos;Radio&apos;,&apos;TextField&apos;,&apos;Textarea&apos;,&apos;Select&apos;,&apos;Button&apos;,&apos;ImageButton&apos;,&apos;HiddenField&apos;],\n" +
      "&apos;/&apos;,\n" +
      "[&apos;Style&apos;,&apos;FontFormat&apos;,&apos;FontName&apos;,&apos;FontSize&apos;],\n" +
      "[&apos;TextColor&apos;,&apos;BGColor&apos;],\n" +
      "&apos;/&apos;,\n" +
      "[&apos;Bold&apos;,&apos;Italic&apos;,&apos;Underline&apos;,&apos;StrikeThrough&apos;,&apos;-&apos;,&apos;Subscript&apos;,&apos;Superscript&apos;],\n" +
      "[&apos;OrderedList&apos;,&apos;UnorderedList&apos;,&apos;-&apos;,&apos;Outdent&apos;,&apos;Indent&apos;,&apos;Blockquote&apos;],\n" +
      "[&apos;JustifyLeft&apos;,&apos;JustifyCenter&apos;,&apos;JustifyRight&apos;,&apos;JustifyFull&apos;],\n" +
      "[&apos;Link&apos;,&apos;Unlink&apos;,&apos;Anchor&apos;],\n" +
      "[&apos;Image&apos;,&apos;Flash&apos;,&apos;Table&apos;,&apos;Rule&apos;,&apos;Smiley&apos;,&apos;SpecialChar&apos;,&apos;PageBreak&apos;, &apos;-&apos;, &apos;ShowBlocks&apos;],\n" +
      "];\n" +
      "FCKConfig.ToolbarCanCollapse = false;\n";
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                htmlEditor = new JHTMLEditor(HTMLEditorImplementation.FCKEditor,
JHTMLEditor.FCKEditorOptions.setCustomJavascriptConfiguration(configurationScript));
                SendEmail es2 = new SendEmail();
                es2.setSize(new Dimension(800,600));
                es2.add(htmlEditor,BorderLayout.CENTER);
                es2.setLocationByPlatform(true);
                es2.setVisible(true);
            }
        });
    }
    private static JHTMLEditor htmlEditor;
    // Variables declaration - do not modify                     
    private javax.swing.JTextField from;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    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.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPasswordField password;
    private javax.swing.JTextField port;
    private javax.swing.JButton sendEmail;
    private javax.swing.JTextField smtpServer;
    private javax.swing.JTextField subject;
    private javax.swing.JTextField to;
    private javax.swing.JTextField username;
    // End of variables declaration                   
 
}
SMTPAuthenticator.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
 
package EmailSender;
 
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
 
public class SMTPAuthenticator extends Authenticator{
    private String username;
    private String password;
    private boolean needAuth;
 
    public SMTPAuthenticator(String username, String password,boolean needAuth)
    {
        this.username = username;
        this.password = password;
        this.needAuth = needAuth;
    }
 
    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        if (needAuth)
            return new PasswordAuthentication(username, password);
                else return null;
    }
}
EmailSender.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
 
package EmailSender;
 
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
 
/**
 *
 * @author Robert
 */
public class EmailSender {
    private String smtpServer;
    private String port;
    private String user;
    private String password;
    private String auth;
    private String from;
 
    public EmailSender(String smtpServer, String port, String user, String password, String auth, String from) {
        this.smtpServer = smtpServer;
        this.port = port;
        this.user = user;
        this.password = password;
        this.auth = auth;
        this.from = from;
    }
 
    private Properties prepareProperties()
    {
            Properties props = new Properties();
            props.setProperty("mail.smtp.host", smtpServer);
            props.setProperty("mail.smtp.port", port);
            props.setProperty("mail.smtp.user", user);
            props.setProperty("mail.smtp.password", password);
            props.setProperty("mail.smtp.auth", auth);
            return props;
    }
 
    private MimeMessage prepareMessage(Session mailSession,String charset,
                                        String from, String subject,
                                        String HtmlMessage,String[] recipient) {
        //Multipurpose Internet Mail Extensions
        MimeMessage message = null;
        try {
            message = new MimeMessage(mailSession);
            message.setFrom(new InternetAddress(from));
            message.setSubject(subject);
            for (int i=0;i<recipient.length;i++)
                message.addRecipient(Message.RecipientType.TO, new InternetAddress(recipient[i]));
            message.setContent(HtmlMessage, "text/html; charset=\""+charset+"\"");
        } catch (Exception ex) {
            Logger.getLogger(EmailSender.class.getName()).log(Level.SEVERE, null, ex);
        }
        return message;
    }
    public void sendEmail(String subject,String HtmlMessage,String[] to)
    {
        Transport transport = null;
        try {
            Properties props = prepareProperties();
            Session mailSession = Session.getDefaultInstance(
                            props, new SMTPAuthenticator(from, password, true));
            transport =  mailSession.getTransport("smtp");
            MimeMessage message = prepareMessage(mailSession, "ISO-8859-2",
                                                from, subject, HtmlMessage, to);
            transport.connect();
            Transport.send(message);
        } catch (Exception ex) {    
        }
        finally{
            try {
                transport.close();
            } catch (MessagingException ex) {
                Logger.getLogger(EmailSender.class.getName()).
                                                    log(Level.SEVERE, null, ex);
            }
        }
    }
}


mais il affiche cette erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
 
run:
NativeSwing[1]: Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
NativeSwing[1]: 	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
NativeSwing[1]: 	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
NativeSwing[1]: 	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
NativeSwing[1]: 	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
NativeSwing[1]: 	at java.lang.Class.forName0(Native Method)
NativeSwing[1]: 	at java.lang.Class.forName(Class.java:186)
NativeSwing[1]: 	at org.eclipse.swt.graphics.Device.<clinit>(Unknown Source)
NativeSwing[1]: 	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.runNativeSide(SWTNativeInterface.java:1207)
NativeSwing[1]: 	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.main_(SWTNativeInterface.java:1398)
NativeSwing[1]: 	at chrriis.dj.nativeswing.swtimpl.NativeInterface.main(NativeInterface.java:220)
NativeSwing[2]: Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
NativeSwing[2]: 	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
NativeSwing[2]: 	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
NativeSwing[2]: 	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
NativeSwing[2]: 	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
NativeSwing[2]: 	at java.lang.Class.forName0(Native Method)
NativeSwing[2]: 	at java.lang.Class.forName(Class.java:186)
NativeSwing[2]: 	at org.eclipse.swt.graphics.Device.<clinit>(Unknown Source)
NativeSwing[2]: 	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.runNativeSide(SWTNativeInterface.java:1207)
NativeSwing[2]: 	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.main_(SWTNativeInterface.java:1398)
NativeSwing[2]: 	at chrriis.dj.nativeswing.swtimpl.NativeInterface.main(NativeInterface.java:220)
NativeSwing[3]: Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
NativeSwing[3]: 	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
NativeSwing[3]: 	at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
NativeSwing[3]: 	at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
NativeSwing[3]: 	at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
NativeSwing[3]: 	at java.lang.Class.forName0(Native Method)
NativeSwing[3]: 	at java.lang.Class.forName(Class.java:186)
NativeSwing[3]: 	at org.eclipse.swt.graphics.Device.<clinit>(Unknown Source)
NativeSwing[3]: 	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.runNativeSide(SWTNativeInterface.java:1207)
NativeSwing[3]: 	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.main_(SWTNativeInterface.java:1398)
NativeSwing[3]: 	at chrriis.dj.nativeswing.swtimpl.NativeInterface.main(NativeInterface.java:220)
Exception in thread "main" java.lang.RuntimeException: java.net.SocketException: Connection reset
	at chrriis.dj.nativeswing.swtimpl.core.OutProcessSocketsMessagingInterface.openChannel(OutProcessSocketsMessagingInterface.java:67)
	at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.initialize(MessagingInterface.java:57)
	at chrriis.dj.nativeswing.swtimpl.core.OutProcessSocketsMessagingInterface.<init>(OutProcessSocketsMessagingInterface.java:32)
	at chrriis.dj.nativeswing.swtimpl.core.OutProcessSocketsMessagingInterface$SwingOutProcessSocketsMessagingInterface.<init>(OutProcessSocketsMessagingInterface.java:162)
	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.createOutProcessMessagingInterface(SWTNativeInterface.java:1022)
	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.createOutProcessCommunicationChannel(SWTNativeInterface.java:762)
	at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.open_(SWTNativeInterface.java:337)
	at chrriis.dj.nativeswing.swtimpl.NativeInterface.open(NativeInterface.java:100)
	at EmailSender.SendEmail.main(SendEmail.java:209)
Caused by: java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:189)
	at java.net.SocketInputStream.read(SocketInputStream.java:121)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
	at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2283)
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2296)
	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2767)
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:798)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298)
	at chrriis.dj.nativeswing.swtimpl.core.OutProcessSocketsMessagingInterface.openChannel(OutProcessSocketsMessagingInterface.java:65)
	... 8 more
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
pour téléchager le projet :
http://www.mediafire.com/?v496cb0t7269im9

Quelqu'un saurait-il m'expliquer d'où cela peut-il venir ?

Merci d'avance pour votre aide.