Results 1 to 3 of 3
- 02-23-2010, 12:44 AM #1
One option: Put them in a List such as a LinkedList, and then iterate through the list calling setText("").
Other option: getComponents from the Container, iterate through them testing for instanceof JTextField, and if matches, cast and setText("");
Best option: ?
Last edited by Fubarable; 02-23-2010 at 12:57 AM.
- 02-23-2010, 02:48 AM #3
- Join Date
- Jul 2007
- Colombo, Sri Lanka
- Blog Entries
- Rep Power
I think the first option is east to use, and safer since no casting is required. Not a real mess, but I like to avoid it in my applications as much as possible.
- By Steve11235 in forum Advanced JavaReplies: 3Last Post: 02-01-2010, 09:08 AM
- By Talkinjive in forum Web FrameworksReplies: 0Last Post: 01-31-2010, 04:15 PM
- By mlibot in forum New To JavaReplies: 1Last Post: 01-21-2010, 09:20 AM
- By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM
- By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM