资源简介
用mailapi实现的java邮件客户端,能实现简单的邮件收发功能!
代码片段和文件信息
import java.awt.*;
import sun.net.smtp.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import javax.swing.event.*;
import javax.swing.border.*;
public class MailClient extends Jframe{
protected SmtpClient sc;
protected JTextField senderadressessubjectserver;
protected JTextArea message;
protected JButton sendButton;
protected JLabel l1l2l3l4;
protected PrintStream ps;
protected JDialog dialogBox;
protected String toName=““;
public MailClient(){
/*******************************Graphical interface**************************/
super(“SMTP Mail Client“);
getContentPane().setLayout(new BorderLayout());
JPanel header = new JPanel();
JPanel p1=new JPanel(new FlowLayout(FlowLayout.LEFT));
l1=new JLabel(“ To: “);
l1.setForeground(Color.black);
p1.add(l1);
adresses=new JTextField(40);
adresses.addFocusListener(new FocusAdapter(){
public void focusGained(FocusEvent e){
l1.setForeground(new Color(98156245));
}
});
adresses.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e){
l1.setForeground(Color.black);
}
});
p1.add(adresses);
JPanel p2=new JPanel(new FlowLayout(FlowLayout.LEFT));
l2=new JLabel(“ From: “);
l2.setForeground(Color.black);
p2.add(l2);
sender=new JTextField(40);
sender.addFocusListener(new FocusAdapter(){
public void focusGained(FocusEvent e){
l2.setForeground(new Color(98156245));
}
});
sender.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e){
l2.setForeground(Color.black);
}
});
p2.add(sender);
JPanel p3=new JPanel(new FlowLayout(FlowLayout.LEFT));
l3=new JLabel(“ Subject: “);
l3.setForeground(Color.black);
p3.add(l3);
subject=new JTextField(40);
subject.addFocusListener(new FocusAdapter(){
public void focusGained(FocusEvent e){
l3.setForeground(new Color(98156245));
}
});
subject.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e){
l3.setForeground(Color.black);
}
});
p3.add(subject);
JPanel p=new JPanel(new FlowLayout(FlowLayout.LEFT));
l4=new JLabel(“ Server: “);
l4.setForeground(Color.black);
p.add(l4);
server=new JTextField(40);
server.addFocusListener(new FocusAdapter(){
public void focusGained(FocusEvent e){
l4.setForeground(new Color(98156245));
}
});
server.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e){
l4.setForeground(Color.black);
}
});
p.add(server);
JLabel label=new JLabel(“JAVA MAIL CLIENT APPLICATION“);
label.setFont(new Font(“TimesRoman“Font.BOLD20));
label.setForeground(Color.blue);
label.setSize(25030);
label.setHorizontalAlignment(JLabel.CENTER);
header.setLayout(new GridLayout(51));
header.add(label);
header.add(p1);
header.add(p2);
header.add(p3);
header.add(p);
message=new JTextArea(7050);
message.setFont(new Font(“SansSerif“Font.BOLD14));
JScrollPane pScroll=new JScrollPane(message);
pScroll.setBorder(new titledBorder(new
EtchedBorder()“Mail Message“));
JPanel p4=new JPanel(new FlowLayout());
sendButton=new JButton(“SEND MESSAGE“);
sendButton.setM
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 226 2012-05-23 19:14 mailclient\.classpath
文件 386 2012-05-23 19:14 mailclient\.project
文件 740 2012-05-24 15:40 mailclient\MailClient$1.class
文件 623 2012-05-24 15:40 mailclient\MailClient$10.class
文件 757 2012-05-24 15:40 mailclient\MailClient$11.class
文件 744 2012-05-24 15:40 mailclient\MailClient$2.class
文件 740 2012-05-24 15:40 mailclient\MailClient$3.class
文件 744 2012-05-24 15:40 mailclient\MailClient$4.class
文件 740 2012-05-24 15:40 mailclient\MailClient$5.class
文件 744 2012-05-24 15:40 mailclient\MailClient$6.class
文件 740 2012-05-24 15:40 mailclient\MailClient$7.class
文件 744 2012-05-24 15:40 mailclient\MailClient$8.class
文件 1564 2012-05-24 15:40 mailclient\MailClient$9.class
文件 5624 2012-05-24 15:40 mailclient\MailClient.class
文件 5416 2002-01-12 23:22 mailclient\MailClient.java
目录 0 2012-05-24 15:40 mailclient
----------- --------- ---------- ----- ----
20532 16
相关资源
-
java中li
nkedList任意排序 - java连接vfp数据库的
- 《Java从入门到精通》第四版pdf及光盘
- Java开发软件整理Maven、Eclipse、JDK8、
- java 毕业设计外文翻译
- 协同过滤推荐系统 Java
- 实现学生信息管理系统
- Java实现的Apriori算法附测试数据
- JAVA写的四子棋
- 广工Java实验+课设
- java+Access登陆界面
- Java实现的简单JPEG编码程序
- javaweb登陆注册界面
- java web房屋出租系统项目
- 学生成绩管理系统 java源码 以及项目
- 数字时钟java源码
- mchange-commons-java-0.2.15.jar
-
ob
jectOrientedProgrammingwithJava.pdf - java项目实战适合初学者
- 数字图像处理java版源代码
- Java 、Android实现MP4裁剪功能
- java实现RSA算法的大整数编程----实现对
- SHA1或MD5算法获取文件摘要值(JAVA)
- javaWeb激活邮箱验证资料
- javaWeb前后台交互
- oracle+javaweb 电影管理系统
- 《轻量级Java EE企业应用实战第5版》光
- LWJGL-2.90
- javax.servlet的jar包
- 图书租借系统 javaGUI程序
评论
共有 条评论