Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4079249

text.DefaultStyledDocument throws java.util.NoSuchElementException when inserts

XMLWordPrintable

    • 1.1.5
    • sparc
    • solaris_2.5.1
    • Not verified



      Name: akC57697 Date: 09/16/97



      The com.sun.java.swing.text.DefaultStyledDocument throws unexpected
      java.util.NoSuchElementException when inserts empty string.
      Swing version is 0.4.1

      -------------------Example-----------------------------------
      import com.sun.java.swing.text.*;
      import com.sun.java.swing.*;
      public class TestSetText {
        public static void main(String[] args) {
            JTextComponent tc = new JTextComponent();
            tc.setDocument(new DefaultStyledDocument());
            
            try {
              tc.setText("");
            } catch (Exception e) {
             System.out.println("Unexpected "+e);
             return;
            }
          System.out.println("OK. No exceptions.");
        }
      }
      -------------------Output------------------------------------
      java TestSetText
      Unexpected java.util.NoSuchElementException

      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            akuzminorcl Alexander Kuzmin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: