This is not directly possible because of the way MIDP API is setup. MIDP API is split into two parts - High-level API and Low-Level API. High-Level API abstracts all the event handling details and gives you general methods. All classes under Screen fall under this category (hence TextBox) Low-Level API is more open and lets you handle events. Classes under Canvas fall under this category. Since TextBox is a High-Level API, you cannot access a low-level API. Hope this helps.
so i'm stuck with the drawChar() in Canvas is that so? however you said directly my premise is not possible but how about indirectly? could i just call a method inside keyPressed() that would do the TextBox thing? it is said (wrox Professional Java Mobile Programming ch5 p.176) we can mix a Canvas and a Screen in a single application.Just don't mix both high and low level in one single Screen. So the low level would be the keyPressed part and the high level would be the TextBox. i just don't know to go about it. Since Display.setCurrent would only accept 1 displayable.
You could do something like drawing your own 'textbox' using your canvas' paint() method to do the drawing and then use the keyPressed() method to to repaint the screen, adding or removing the appropriate characters from your 'textbox'. Jason
Post by:autobot
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
a bit of art, as a gift, that will fit in a stocking