File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 17249

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
Similar Threads
Making a JComboBox uneditable
Make JTable cells not editable
Help with choice group..
Displaying Files in awt