简体   繁体   中英

Textbox on canvas in j2me

I am going to make application on j2me using canvas. I want to take textbox or textfield on my canvas.

You can draw a basic textbox and display a string , and when it receives focus, you can switch the view to that particular textbox ,something like this

textBox = new TextBox(....);
Midlet.display.setCurrent(textBox);

This would create your data entry more robust and save you from the pain of implementing various keyboard issues yourselves

These items are only available for adding to Form s . Canvas is a class for handling lower-level events.

You have to implement your own textbox, and that isn't easy.
Basic textbox would be a rectangle ( drawRect ) with text ( drawString ) inside of it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM