📄 viewemail.java
字号:
package Email.awt.net;
import java.awt.*;
import java.awt.event.*;
import Email.net.*;
import Email.awt.*;
public class ViewEmail extends WinFrame {
private Mailbox mailbox;
private Email email;
private Button replyToButton = new Button("Reply to");
private Button replyToAllButton = new Button("Reply to all");
private Button forwardButton = new Button("Forward");
public ViewEmail(final Mailbox mailbox, final Email email) {
super( email.getSubject() );
this.mailbox = mailbox;
this.email = email;
ViewEmailPanel vep = new ViewEmailPanel( email );
add("Center",vep);
Panel p = new Panel();
p.add( replyToButton );
p.add( replyToAllButton );
p.add( forwardButton );
add( "South",p );
pack();
//回复邮件
replyToButton.addActionListener
(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
Email em = email.replyTo(ViewEmail.this);
new ComposeEmail( em.getSubject(),mailbox,em ).setVisible(true);
}
}
);
//回复邮件
replyToAllButton.addActionListener
(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
Email em = email.replyToAll(ViewEmail.this);
new ComposeEmail( em.getSubject(),mailbox,em ).setVisible(true);
}
}
);
//转发邮件
forwardButton.addActionListener
(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
Email em = email.forward();
new ComposeEmail( em.getSubject(),mailbox,em ).setVisible(true);
}
}
);
}
/*
public static void main(String[] args) {
new ViewEmail(
new Mailbox() { public void post(Email e) {} },
new Email
(
"From: wy82@21cn.com \n" +
"To: psw82@126.com\n" +
"Subject: Hello"
)
).appMainWindow().setVisible(true);
}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -