/*
  * Test method for 'java.awt.TextArea.replaceRange(String, int, int)'
  */
 public void testReplaceRange() {
   int start = 8;
   int end = 11;
   String text = "This is old text";
   area.setText(text);
   String str = "brand new";
   area.replaceRange(str, start, end);
   assertEquals("This is brand new text", area.getText());
   assertEquals("", area.getSelectedText());
   assertEquals(0, area.getRows());
   assertEquals(0, area.getCaretPosition());
 }
예제 #2
0
 /**
  * Replaces the text bounded by the specified start and end positions with the specified text.
  *
  * @param text The new text for the range.
  * @param start The start position of the replacement range.
  * @param end The end position of the replacement range.
  * @deprecated This method is deprecated in favor of <code>replaceRange()</code>.
  */
 public void replaceText(String text, int start, int end) {
   replaceRange(text, start, end);
 }