wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes Are there a way to put a Form and a TextBox in one display? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Are there a way to put a Form and a TextBox in one display?" Watch "Are there a way to put a Form and a TextBox in one display?" New topic
Author

Are there a way to put a Form and a TextBox in one display?

anh tuan
Greenhorn

Joined: Sep 04, 2009
Posts: 3
Hi everyone, i'm a newbie in Java and also in J2ME. I'm practising in J2ME and i want to write an application in which there are a textfield for phone number, and a textbox for message content. But my book only show me how to put a textfield on a form, then display.setCurrent(form) . Please tell me are there a way to put my Form and TextBox together? And i'm a vietnamese, so don't get mad with my English


J2ME - Android
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

We get lots worse English than that. But a Form is a container for GUI controls, so the TextBox has to go inside a form. So not only is there a way, you actually have to do it that way. Otherwise it won't work!


Customer surveys are for companies who didn't pay proper attention to begin with.
anh tuan
Greenhorn

Joined: Sep 04, 2009
Posts: 3
Thank you for answering, but i still don't get it. Because Form and TextBox both are extend class of Display, how can i put a TextBox inside a Form. Can you show me some code for example?
anh tuan
Greenhorn

Joined: Sep 04, 2009
Posts: 3
And i also have a problem in keyPressed. I'm writing a calculator run on mobile, and when i want to catch the key-up pressed event, i found out there're no keycode for that event. There are KEY_NUM0, KEY_NUM1... but no KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT and KEY_SELECT (the key at the center). I tried to use the UP, DOWN,... in game action but it didn't work. Thanks for any help, especially if there are code for example.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Are there a way to put a Form and a TextBox in one display?
 
Similar Threads
static content access
MIDP: Difference between textfield and textbox
Consuming "Hello"web service from mobile
how to display Form and Canvas based UI together?
problem in getting values using EL