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

text.DefaultStyledDocument throws java.util.NoSuchElementException when inserts

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1.5
    • CPU:
      sparc
    • OS:
      solaris_2.5.1
    • Verification:
      Not verified

      Description



      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

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

        Attachments

          Activity

            People

            Assignee:
            tprinzinsunw Timothy Prinzing (Inactive)
            Reporter:
            akuzminorcl Alexander Kuzmin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: