📄 viewemail.java
字号:
package jws.awt.net;
// Copyright 1997, John Webster Small
// All rights Reserved
import java.awt.*;
import java.awt.event.*;
import jws.net.*;
import jws.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: jsmall@laser.net \n" +
"To: wdelias@access.digex.net\n" +
"Subject: misc\n\nHi Wayne E.,\nHi!\nsdf;lk"
)
).appMainWindow().setVisible(true);
}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -