J
Jenny
Hi All,
The code below give me an err csused by a.insert("test \none",10).
If I use a.insert("test \none",0), it is OK. What can I do to use an
int >0 as position?
JTextArea a = new JTextArea(3,50);
a.insert("test \none",10);
Thanks.
The following is the info for insert.
public void insert(String str,
int pos)Inserts the specified text at the specified
position. Does nothing if the model is null or if the text is null or
empty.
This method is thread safe, although most Swing methods are not.
Please see Threads and Swing for more information.
Parameters:
str - the text to insert
pos - the position at which to insert >= 0
Throws:
IllegalArgumentException - if pos is an invalid position in the model
The code below give me an err csused by a.insert("test \none",10).
If I use a.insert("test \none",0), it is OK. What can I do to use an
int >0 as position?
JTextArea a = new JTextArea(3,50);
a.insert("test \none",10);
Thanks.
The following is the info for insert.
public void insert(String str,
int pos)Inserts the specified text at the specified
position. Does nothing if the model is null or if the text is null or
empty.
This method is thread safe, although most Swing methods are not.
Please see Threads and Swing for more information.
Parameters:
str - the text to insert
pos - the position at which to insert >= 0
Throws:
IllegalArgumentException - if pos is an invalid position in the model