Can anyone suggest a method to clear the text in the JTextArea? Puja
T Pelly
Greenhorn
Joined: Jun 29, 2001
Posts: 5
posted
0
Try using the method: replaceRange(String str, int start, int end) str = "" start = 0 end = 'how ever many character you have' There must be a cleaner way, but I'm not sure what it is!
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
1
Hi puja, How about something simple like: setText(""); According to API:
Sets the text of this TextComponent to the specified text. If the text is null or empty, has the effect of simply deleting the old text.