Forums Register Login

JTextField.setEditable is not working

+Pie Number of slices to send: Send
Hello All,
I was trying to set a value to the text box and then i want to make it uneditable, so i am trying to do the following steps,
String value = "Dynamic";
JTextField jtxt = new JTextField();
jtxt.setText(value);
jtxt.setEditable(false);
But it is not working, still i am able to change the value in the text field.
Please let me know what to do to make it disable.
Regards,
Sri.
+Pie Number of slices to send: Send
why not use a JLabel instead?
+Pie Number of slices to send: Send
this works for me:
+Pie Number of slices to send: Send
 

Originally posted by miguel lisboa:
this works for me:



We've posted the same in the sun forums, but no response from sri rallapalli as yet. I can only assume that his logic is breaking somewhere else in his code.
The knights of nee want a shrubbery. And a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2523 times.
Similar Threads
JTable numeric validation
During creation, getting original value from javabean
During creation, getting original value from javabean
Is it possible to bind a component with two other components
Get JTextField value from different class
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:57:34.