J2ME, why can't register CommandListener () from Canvas?

B

Boki

Hi All,

Why can't register CommandListener () from Canvas?

MyGUI extends Canvas
{
....
myMIDlet.myForm.setCommandListener(myMIDlet.myForm);
....
}


Error output:
setCommandListener in javax.microedition.lcdui.Displayable cannot be applied
to javax.microedition.lcdui.From


----------
How can I change my CommandListener from MyGUI.java to myMIDlet.java

Thank you very much for your help.

Best regards,
Boki.
 
D

Darryl Pierce

Boki said:
Hi All,

Why can't register CommandListener () from Canvas?

MyGUI extends Canvas
{
....
myMIDlet.myForm.setCommandListener(myMIDlet.myForm);
....
}


Error output:
setCommandListener in javax.microedition.lcdui.Displayable cannot be applied
to javax.microedition.lcdui.From

Your Form object obviously does not implement the CommandListener interface.
 
D

Darryl Pierce

Boki said:
Yes, I did......@@

Well, honestly, it's hard to tell since you're not cutting and pasting
the real text but typing it in.

Post the real text and we can help you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top