/[classpath]/classpath/javax/swing/JTextArea.java
ViewVC logotype

Diff of /classpath/javax/swing/JTextArea.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by mkoch, Mon Sep 27 07:11:04 2004 UTC revision 1.6 by mkoch, Mon Sep 27 13:03:35 2004 UTC
# Line 436  public class JTextArea extends JTextComp Line 436  public class JTextArea extends JTextComp
436     */     */
437    public void insert(String string, int position)    public void insert(String string, int position)
438    {    {
439        // Retrieve the document model.      // Retrieve the document model.
440        Document document = getDocument();      Document doc = getDocument();
441                
442        // Check the model and string for validity.      // Check the model and string for validity.
443        if (document == null      if (doc == null
444            || string == null          || string == null
445            || string.length() == 0)          || string.length() == 0)
446          return;        return;
447          
448        // Insert the text into the model.      // Insert the text into the model.
449        try      try
450          {        {
451            document.insertString(position, string, null);          doc.insertString(position, string, null);
452          }        }
453        catch (BadLocationException exception)      catch (BadLocationException e)
454          {        {
455            throw new IllegalArgumentException("The supplied position, "          throw new IllegalArgumentException("The supplied position, "
456                                               + position + ", was invalid.");                                             + position + ", was invalid.");
457          }        }
458    }    }
459    
460    public void replaceRange(String text, int start, int end)    public void replaceRange(String text, int start, int end)

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26