posted 14 years ago
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.
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.
Cheers, Sathya Srinivasan - SCJP 1.2, SCWCD 1.2, SCMAD 1.0
Co-Author of Whizlabs SCMAD Certification Exam Simulator and SCMAD Exam Guide Book
Benjoe Reyes
Ranch Hand
Posts: 109
posted 14 years ago
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.
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.
