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

Double-clicking on a JTextField with no text causes IllegalArgumentException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1.5
    • 1.1.5
    • client-libs
    • None
    • 1.1.5
    • sparc
    • solaris_2.5.1


        Double-clicking on a textfield with no text causes the following IllegalArgumentException:

        Exception occurred during event dispatching:
        java.lang.IllegalArgumentException: nextBoundaryAt offset out of bounds
                at java.text.SimpleTextBoundary.following(SimpleTextBoundary.java:235)
                at com.sun.java.swing.text.DefaultTextController.mouseClicked(DefaultTextController.java:283)
                at com.sun.java.swing.JTextField$1.mouseClicked(JTextField.java:398)
                at java.awt.Component.processMouseEvent(Component.java:2287)
                at java.awt.Component.processEvent(Component.java:2129)
                at java.awt.Container.processEvent(Container.java:895)
                at java.awt.Component.dispatchEventImpl(Component.java:1764)
                at java.awt.Container.dispatchEventImpl(Container.java:940)
                at java.awt.Component.dispatchEvent(Component.java:1704)
                at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:1550)
                at java.awt.LightweightDispatcher.processMouseEvent(Container.java:1466)
                at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1394)
                at java.awt.Container.dispatchEventImpl(Container.java:927)
                at java.awt.Window.dispatchEventImpl(Window.java:443)
                at java.awt.Component.dispatchEvent(Component.java:1704)
                at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)


        The following application demonstrates this.
        To recreate, bring up the app and double-click on the textfield that is
        presented.

        ============================================================================
        /*
        TextFieldTest.java
        Double-clicking on a textfield with no text causes an IllegalArgumentException
        */

        import com.sun.java.swing.*;

        public class TextFieldTest
        {
           public static void main( String[] args )
           {
              JFrame f = new JFrame();
              JPanel p = new JPanel();
              final JTextField text = new JTextField(4);

              p.add( text );

              f.add( p );
              f.pack();
              f.show();
           }
        }
        ============================================================================

              jeff Jeff Dinkins
              gaurisha Gauri Sharma (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: