Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

j2ME: How can i make a textfield uneditable

 
Sangeeta Vepa
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
TIA
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Mark
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!