tags:

views:

264

answers:

2

Hi All,

I want to design one form that contains TextField and ListView in J2ME. But I don't know how to create this form. It is looked like Dictionary Form. Could anybody help me to do that?. Thanks, Ung Sopolin

A: 

You can't really do that with the basic UI controls in MIDP.

List can't contain TextField.

I would suggest looking at LWUIT since it has better controls.

Otherwise, if you don't need to display Images in your List, then you can use a Form containing both TextField and StringItem. Unfortunately, an ItemStateListener added to the Form will probably not give you as much information as a List.

Implementing the list yourself in a CustomItem means writing quite a bit of code but is doable.

If what you need is a TextField where you enter a search String and a List that displays the search result, I suggest using a TextBox first, then a List. Separate screens are by far the quickest solution here.

Edit: you can't use swing in j2me. what you can do is have just a textfield in a form, then add/remove StringItems to/from the Form when the user changes the content of the TextField. You should be able to rely on ItemStateListener to tell you when the textfield content changes.

QuickRecipesOnSymbianOS
Hi, I understand what you said. But I want to a form that contain a text to type and the list will be show the word that I type in the text. If I use tableItem with text field, is it ok?
Sopolin
Hi, if I want to use swing interface with j2me, can I ?
Sopolin
I also have the same problem. But I'm implementing checkboxes using CustomItem. I want the user interface to be the same as the Nokia's phonebook application.
jean27
A: 

Hi Sopolin

I've tried to do the same thing. I want a TexField and List on the same form but I don't know how.

If you got the solution please let me know

my email address is [email protected]

Thank you.

ijAcK
Hi ijAck, now I haven't yet got any solution. When I get, I will mail to you. Thanks
Sopolin