Maximiliano Poggio
Maximiliano Poggio

Reputation: 1182

J2ME TextBox not editable

Is there any way to get a TextBox in j2me not editable?

Because I want to fill a lot of lines but I don't want the user to edit it.

Upvotes: 2

Views: 1105

Answers (3)

Yatin
Yatin

Reputation: 3120

Use constraint as TextField.UNEDITABLE

Upvotes: 2

gnat
gnat

Reputation: 6228

For Textbox, this can be achieved by setting TextField.UNEDITABLE constraint (TextField is not a typo):

Indicates that editing is currently disallowed. When this flag is set, the implementation must prevent the user from changing the text contents of this object. The implementation should also provide a visual indication that the object's text cannot be edited. The intent of this flag is that this text object has the potential to be edited, and that there are circumstances where the application will clear this flag and allow the user to edit the contents.

The UNEDITABLE modifier can be combined with other input constraints by using the bit-wise OR operator (|).

UNEDITABLE modifier can be set in TextBox constructor, as well as using setConstraints method. If you're interested in more details on that, refer to TextBox API javadocs

Upvotes: 3

TimVK
TimVK

Reputation: 1146

Isn't it a solution to use a TextField in stead?

Upvotes: -2

Related Questions