This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes j2ME: How can i make a textfield uneditable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "j2ME: How can i make a textfield uneditable" Watch "j2ME: How can i make a textfield uneditable" New topic

j2ME: How can i make a textfield uneditable

Sangeeta Vepa

Joined: Sep 20, 2003
Posts: 22
Hi all,
I am writing an application in which i am using a textfield as a combo box. So as soon as the user goes to the textfield i donot want him to write anything in the textfield. I have created a list from which he would select the records. The list is ready but i am still left with making the textfield uneditable.
Could CONSTRAINT_MASK be of any use. Please pen me the syntax for the solution.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17271

If you are trying to create a ComboBox, why not just use the class that is available in the lcdui package, ChoiceGroup, instead of trying to create your own from scratch.
Use the constraint "UNEDITABLE" when you create the TextField. This will do that trick.

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: j2ME: How can i make a textfield uneditable
It's not a secret anymore!