Problem description
Use java-swing technology to send mail. (Why use Java, because our group has not learned C #)
- Mail editing uses a rich text editor that allows users to customize the message format.
- Supports uploading images.
- Supports sending attachments.
- Content supports the substitution of names as if they were sent individually to someone.
function Picture Show
Resolution process
Start to see this demand, there is no idea feel good, so Baidu, Google a bunch of things. First of all, Baidu Java Swing's Rich Text editor component, although did find a few components but are very old version, and is a separate pop-up window, style is a bit ugly. Asked the elder's opinion, said: "Can not accept the independent pop-up window, also not very good-looking". Then continue to query.
Query how to implement the mail editor in Java Swing, Google to a blog how to use the Rich Text editor in Eclipse RCP (Rich editor) to learn the two ways to implement the editor, Then decided to use SWT in the second way to build a browser using the Rich text editor in the Web to use the editing features of the mail (I used to use the Web Rich Text editor).
So Baidu how to implement Java browser, online has a lot of tutorials, here refer to this blog Java Web browser component Introduction so I adopted the SWT browser component, Baidu will find a lot of this kind of tutorial I also forgot to see that one, csdn on a class library of the compression package, Note Here whether you are using a 32-bit or 64-bit Java environment. However, there is a problem with rich text editing browser compatibility.
Found a good compatibility table Rich Text editor Summer official website. File upload is a rich text support way, anyway just show up and then send to other mailboxes.
The replacement of the name uses a Jsoup class library tutorial address.
Summary of issues
Solving this problem wasted a lot of time, although the demand is relatively rare and client development, but decided to write a blog share.
Implement Rich Text editor in java-swing