Two Laptop Bag
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 Building Microservices this week in the Design 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

Use of keyPressed to call a form

Paul Dudek

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) {

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,

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Use of keyPressed to call a form
jQuery in Action, 3rd edition