my dog learned polymorphism*
The moose likes Java Micro Edition and the fly likes Use of keyPressed to call a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Use of keyPressed to call a form" Watch "Use of keyPressed to call a form" New topic
Author

Use of keyPressed to call a form

Paul Dudek
Greenhorn

Joined: Jul 21, 2006
Posts: 8
Hi there,
It is easy enough to change the current Display using commandAction for the soft buttons as this method resides inside the main MIDlet class.
You would simply use something like:

Display d = Display.getDisplay(this);

public void commandAction(Command c, Displayable s) {
if (c == formCommand) {
d.setCurrent(myForm);
}

I was wondering if anyone could tell me how to change display from a Canvas to a Form using keyPressed() which is a method of the Canvas class.
I would rather not have to draw a Form on the Canvas.

Many Thanks,

Paul.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Use of keyPressed to call a form
 
Similar Threads
KeyPressed event in canvas using j2me
calling another class in src
Newbie: End app after alert
some other class drawing on a canvas
Help on KeyPressed()?