FileDocCategorySizeDatePackage
SMTPApplet.javaAPI DocExample2990Mon Oct 09 13:10:02 BST 2000None

SMTPApplet

public class SMTPApplet extends Applet

Fields Summary
private Button
sendButton
private Label
fromLabel
private Label
subjectLabel
private TextField
fromField
private TextField
subjectField
private TextArea
message
private String
toAddress
Constructors Summary
public SMTPApplet()


    
    
    this.setLayout(new BorderLayout());
    
    Panel north = new Panel();
    north.setLayout(new GridLayout(3, 1));
    
    Panel n1 = new Panel();
    n1.add(fromLabel);
    n1.add(fromField);
    north.add(n1);
    
    Panel n2 = new Panel();
    n2.add(subjectLabel);
    n2.add(subjectField);
    north.add(n2);

    this.add(north, BorderLayout.NORTH);
    
    message.setFont(new Font("Monospaced", Font.PLAIN, 12));
    this.add(message, BorderLayout.CENTER);

    Panel south = new Panel();
    south.setLayout(new FlowLayout(FlowLayout.CENTER));
    south.add(sendButton);
    sendButton.addActionListener(new SendAction());
    this.add(south, BorderLayout.SOUTH);    
    
  
Methods Summary
public voidinit()

    
    String subject = this.getParameter("subject");
    if (subject == null) subject = "";
    subjectField.setText(subject);
    
    toAddress = this.getParameter("to");
    if (toAddress == null) toAddress = "";
    
    String fromAddress = this.getParameter("from");
    if (fromAddress == null) fromAddress = ""; 
    fromField.setText(fromAddress);