?? spmail.java
字號:
package mail;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.mail.*;
import javax.mail.internet.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.*;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class spmail extends JFrame {
JPanel contentPane;
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JLabel jLabel1 = new JLabel();
public spmail() {
setResizable(false);
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* Component initialization.
*
* @throws java.lang.Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(400, 300));
setTitle("簡單郵件系統");
jButton1.setBounds(new Rectangle(146, 145, 98, 27));
jButton1.setFont(new java.awt.Font("幼圓", Font.BOLD, 15));
jButton1.setText("發郵件");
jButton1.addActionListener(new spmail_jButton1_actionAdapter(this));
jButton2.setBounds(new Rectangle(146, 182, 100, 25));
jButton2.setFont(new java.awt.Font("幼圓", Font.BOLD, 15));
jButton2.setText("收郵件");
jButton2.addActionListener(new spmail_jButton2_actionAdapter(this));
jLabel1.setFont(new java.awt.Font("華文彩云", Font.BOLD, 50));
jLabel1.setText("JavaMail");
jLabel1.setBounds(new Rectangle(89, 42, 234, 69));
contentPane.add(jButton2);
contentPane.add(jButton1);
contentPane.add(jLabel1);
}
public void jButton1_actionPerformed(ActionEvent e) {
Smtp smtp=new Smtp();
smtp.show();
}
public void jButton2_actionPerformed(ActionEvent e) {
POP3 pop3=new POP3();
pop3.show();
}
}
class spmail_jButton2_actionAdapter implements ActionListener {
private spmail adaptee;
spmail_jButton2_actionAdapter(spmail adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class spmail_jButton1_actionAdapter implements ActionListener {
private spmail adaptee;
spmail_jButton1_actionAdapter(spmail adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -