291 |
* Sets the caret position to the specified value. |
* Sets the caret position to the specified value. |
292 |
* |
* |
293 |
* @param caretPosition The new caret position. |
* @param caretPosition The new caret position. |
294 |
|
* |
295 |
|
* @exception IllegalArgumentException If the value supplied for position |
296 |
|
* is less than zero. |
297 |
|
* |
298 |
|
* @since 1.1 |
299 |
*/ |
*/ |
300 |
public synchronized void |
public synchronized void |
301 |
setCaretPosition(int caretPosition) |
setCaretPosition(int caretPosition) |
302 |
{ |
{ |
303 |
|
if (caretPosition < 0) |
304 |
|
throw new IllegalArgumentException (); |
305 |
|
|
306 |
TextComponentPeer tcp = (TextComponentPeer)getPeer(); |
TextComponentPeer tcp = (TextComponentPeer)getPeer(); |
307 |
if (tcp != null) |
if (tcp != null) |
308 |
tcp.setCaretPosition(caretPosition); |
tcp.setCaretPosition(caretPosition); |