home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Mail For Me / Mail4ME.jar / de / trantor / mail / demo / j2me / ReadScreen.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-10-21  |  2.2 KB  |  57 lines

  1. package de.trantor.mail.demo.j2me;
  2.  
  3. import javax.microedition.lcdui.Command;
  4. import javax.microedition.lcdui.Displayable;
  5. import javax.microedition.lcdui.Form;
  6. import javax.microedition.lcdui.Image;
  7. import javax.microedition.lcdui.StringItem;
  8.  
  9. public class ReadScreen extends Form {
  10.    private StringItem sender = new StringItem("From:", "");
  11.    private StringItem date = new StringItem("Date:", "");
  12.    private StringItem subject = new StringItem("Subject:", "");
  13.    // $FF: renamed from: OK javax.microedition.lcdui.Command
  14.    public static Command field_0 = new Command("Ok", 1, 1);
  15.  
  16.    public ReadScreen(MailMIDlet midlet) {
  17.       super("Read");
  18.       ((Form)this).append(this.sender);
  19.       ((Form)this).append(this.date);
  20.       ((Form)this).append(this.subject);
  21.       ((Displayable)this).addCommand(field_0);
  22.       ((Displayable)this).setCommandListener(midlet);
  23.    }
  24.  
  25.    public void setSender(String sender) {
  26.       this.sender.setText(sender);
  27.    }
  28.  
  29.    public void setDate(String date) {
  30.       this.date.setText(date);
  31.    }
  32.  
  33.    public void setSubject(String subject) {
  34.       this.subject.setText(subject);
  35.    }
  36.  
  37.    public void clearBody() {
  38.       for(int i = ((Form)this).size() - 1; i > 2; --i) {
  39.          ((Form)this).delete(i);
  40.       }
  41.  
  42.    }
  43.  
  44.    public void addBody(String line) {
  45.       if (line.equals("")) {
  46.          ((Form)this).append(" ");
  47.       } else {
  48.          ((Form)this).append(line);
  49.       }
  50.  
  51.    }
  52.  
  53.    public void addImage(Image image) {
  54.       ((Form)this).append(image);
  55.    }
  56. }
  57.