home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Chess / Fly_Chess.jar / MessageForm.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-08-23  |  1.4 KB  |  32 lines

  1. import javax.microedition.lcdui.Command;
  2. import javax.microedition.lcdui.CommandListener;
  3. import javax.microedition.lcdui.Display;
  4. import javax.microedition.lcdui.Displayable;
  5. import javax.microedition.lcdui.Form;
  6.  
  7. public class MessageForm implements CommandListener, ChessDisplayable {
  8.    private ChessDisplayable chessreturn = null;
  9.    private Form form = null;
  10.    private Command OKCommand;
  11.  
  12.    public MessageForm(String var1, String var2, ChessDisplayable var3) {
  13.       this.chessreturn = var3;
  14.       this.form = new Form(var1);
  15.       this.OKCommand = new Command("OK", 4, 1);
  16.       this.form.addCommand(this.OKCommand);
  17.       this.form.append(var2);
  18.    }
  19.  
  20.    public void commandAction(Command var1, Displayable var2) {
  21.       if (var1 == this.OKCommand) {
  22.          this.chessreturn.makeCurrent(CU.getDisplay());
  23.       }
  24.  
  25.    }
  26.  
  27.    public void makeCurrent(Display var1) {
  28.       var1.setCurrent(this.form);
  29.       this.form.setCommandListener(this);
  30.    }
  31. }
  32.