Results 1 to 5 of 5
- 08-19-2011, 08:15 PM #1
Make the TextField unable to write on
Hello there! I was wondering if there was any kind of method that could make a TextField unable to write on it. It's an usual action of textfields in programs, when you select an option that makes the textfield grey-colored and unable to write on it. I'd like to know if there is a method that could perform this action in Java textfields. I hope there is one, thanks.
- 08-19-2011, 08:19 PM #2
Are you looking for the setEnabled() or setEditable() methods? Check out the API: JTextField (Java Platform SE 6)
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 08-19-2011, 09:13 PM #3
- 08-21-2011, 02:08 AM #4
Java Code:JTextField field = new JTextField(); field.setEditable(true); //if you want to put text in it field.setEditable(false); //if you want to deactivate the textfield and make it uneditable which means you can't type.
- 08-21-2011, 08:06 AM #5
Similar Threads
-
How to write a code for defining a maxlenght for a textfield ?!
By qwerty53 in forum New To JavaReplies: 3Last Post: 07-06-2011, 12:50 PM -
Unable to write/post to a URL from Java
By achab in forum Advanced JavaReplies: 38Last Post: 11-06-2010, 01:21 AM -
Unable to create and write files
By DrKilljoy in forum New To JavaReplies: 4Last Post: 09-05-2010, 12:55 AM -
How to make Swing JTextField look like AWT TextField?
By LeonLanford in forum AWT / SwingReplies: 1Last Post: 09-04-2010, 04:06 PM -
how to make window active and textfield focused
By whwillisiv in forum New To JavaReplies: 0Last Post: 04-28-2009, 04:06 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks