Command Listener::J2ME

From: Jason D Wolfe (jason_d_wolfe_at_comcast.net)
Date: 08/24/04


Date: Tue, 24 Aug 2004 03:57:38 GMT

If this is not appropriate for this newsgroup I apologize in advance, please
direct me to the appropriate group...

I have created a canvas object and set it as the current displayable in the
current display. The command listner is the class that I created and called
the canvas object from. I added commands to the canvas, to be caught by the
commandListener (which is set to the class that created the canvas). The
problem is this... Since I registered and added the exit command, a 'soft'
command, it is caught and it works correctly.... If I press a number key, it
is caught by the canvas object... If I want to press a number key, and have
it 'appear' to execute a function that is part of the calling class
(basically be caught by the command listener as does the exit 'softkey'....
how do I do this? I suspect that it would be something like this...

  protected void keyPressed(int keyCode) {
           if (keyCode == 1) {
                   'classThatCreatedThisCanvas'.doWhatIWant();
             }
     }

In the end, I just want to give control back to where it was before the
canvas so that I can create other canvases and set them as the current
displayable

THANKS SO MUCH FOR THE HELP.

Jason Wolfe.



Relevant Pages

  • CommandListerer:::J2ME
    ... I have created a canvas object and set it as the current displayable in the ... current display. ... The command listner is the class that I created and called ...
    (comp.lang.java)
  • Re: Command Listener::J2ME
    ... >I have created a canvas object and set it as the current displayable in the ... >current display. ... The command listner is the class that I created and called ... >the canvas object from. ...
    (comp.lang.java.gui)
  • Re: Aspect Ratio revisited
    ... command and/or option you used in the literature to understnd what it ... bottom then I and launch your main proc that I called "canvas_resize". ... It draws the final resized canvas with the properly resclaled objcets ... # should the objects move or resize? ...
    (comp.lang.tcl)
  • TIP #236: Absolute Positioning of Canvas Items
    ... ABSOLUTE POSITIONING OF CANVAS ITEMS ... This TIP proposes adding a canvas widget command to set the absolute ... bounding box lies at the point. ...
    (comp.lang.tcl)
  • Re: J2ME, Canvas,
    ... I create a Form from MIDlet and show it when MIDlet startApp, ... > Command and calling Canvas.addCommand? ... > create the Canvas and where you add the Command to the Canvas. ... > objects can and do display Commands, so the problem's in your code ...
    (comp.lang.java.programmer)