I added a JTextField to the south of the window.
Now I want to make this textField set to false.

cp.add(BorderLayout.SOUTH, new JTextField ("Starting..."));

11-18-2010, 09:42 PM

Fubarable

Can a JTextField be set to a boolean?

Please clarify your question a bit.

11-18-2010, 09:43 PM

globo

Oh ok

I mean I would to set that textfield to be non-editable.

11-18-2010, 09:46 PM

Fubarable

Quote:

Originally Posted by globo

I added a JTextField to the south of the window.
Now I want to make this textField set to false.

cp.add(BorderLayout.SOUTH, new JTextField ("Starting..."));

If you want to make the JTextField non-editable, you probably don't want to create an anonymous object as you're doing above. Create a JTextField variable, either local if you're just going to need its reference locally or a class field if you need the reference for the entire object.