Java Reference
In-Depth Information
catch (java.io.IOException x) {
throw new RuntimeException ("Images not found");
}
setCommandListener(this);
}
public void commandAction (Command c, Displayable d) {
if (c == List.SELECT_COMMAND) {
teleTransfer.amountWhole.setLabel
(CURRENCY_NAMES [getSelectedIndex()]);
teleTransfer.amountFraction.setLabel
(CURRENCY_FRACTIONS [getSelectedIndex()]);
teleTransfer.back();
}
}
}
class TransferReason extends TextBox implements CommandListener {
static final Command okCommand = new Command ("OK", Command.BACK,
1);
static final Command clearCommand = new Command
("Clear", Command.SCREEN, 2);
TeleTransfer teleTransfer;
public TransferReason (TeleTransfer teleTransfer) {
super ("Transfer Reason", "", 50, TextField.ANY);
this.teleTransfer = teleTransfer;
addCommand (okCommand);
addCommand (clearCommand);
setCommandListener(this);
}
public void commandAction (Command c, Displayable d) {
if (c == clearCommand) {
setString ("");
}
else if (c == okCommand) {
teleTransfer.back();
}
}
}
public class TeleTransfer extends MIDlet implements CommandListener {
static final Command sendCommand = new Command ("Send",
Command.SCREEN, 2);
static final Command clearCommand = new Command
("Clear", Command.SCREEN, 2);
static final Command exitCommand = new Command ("Exit",
Command.SCREEN, 1);
static final Command currencyCommand = new Command
("Currency", Command.SCREEN, 2);
static final Command reasonCommand = new Command
("Reason", Command.SCREEN, 2);
Form mainForm = new Form ("TeleTransfer");
Search WWH ::




Custom Search