swingx
  1. swingx
  2. SWINGX-1480

AutoCompleteDecorator.decorate throwing java.lang.IllegalArgumentException: bad position

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.7
    • Fix Version/s: None
    • Component/s: Autocomplete
    • Labels:
      None
    • Environment:

      Windows XP, Java SE 6

      Description

      AutoCompleteDecorator.decorate(JTextField , List<Object> , true )
      throws "java.lang.IllegalArgumentException: bad position" when we enter something in the JTextField which is not pre-defined.
      For this i am using swingx-0.9.7.jar.

      Full Description of Exception:

      java.lang.IllegalArgumentException: bad position: 2
      at javax.swing.text.JTextComponent.moveCaretPosition(Unknown Source) ~[na:1.6.0_26]
      at org.jdesktop.swingx.autocomplete.AbstractAutoCompleteAdaptor.markText(AbstractAutoCompleteAdaptor.java:116) ~[na:n
      a]
      at org.jdesktop.swingx.autocomplete.AutoCompleteDocument.insertString(AutoCompleteDocument.java:272) ~[na:na]
      at javax.swing.text.JTextComponent.replaceSelection(Unknown Source) ~[na:1.6.0_26]
      at javax.swing.text.DefaultEditorKit$DefaultKeyTypedAction.actionPerformed(Unknown Source) ~[na:1.6.0_26]
      at javax.swing.SwingUtilities.notifyAction(Unknown Source) ~[na:1.6.0_26]
      at javax.swing.JComponent.processKeyBinding(Unknown Source) ~[na:1.6.0_26]
      at javax.swing.JComponent.processKeyBindings(Unknown Source) ~[na:1.6.0_26]
      at javax.swing.JComponent.processKeyEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Component.processEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Container.processEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Component.dispatchEventImpl(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Container.dispatchEventImpl(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Component.dispatchEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source) ~[na:1.6.0_26]
      at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Component.dispatchEventImpl(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Container.dispatchEventImpl(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Window.dispatchEventImpl(Unknown Source) ~[na:1.6.0_26]
      at java.awt.Component.dispatchEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventQueue.access$000(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventQueue$1.run(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventQueue$1.run(Unknown Source) ~[na:1.6.0_26]
      at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_26]
      at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) ~[na:1.6.0_26]
      at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventQueue$2.run(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventQueue$2.run(Unknown Source) ~[na:1.6.0_26]
      at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_26]
      at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventQueue.dispatchEvent(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source) ~[na:1.6.0_26]
      at java.awt.EventDispatchThread.run(Unknown Source) ~[na:1.6.0_26]

      But when i make strictMatching parameter as false i.e AutoCompleteDecorator.decorate(JTextField , List<Object> , false ) , the exception is not thrown.

        Activity

        Hide
        Karl Schaefer added a comment -

        Does this occur in SwingX 1.6.2?

        Can you provide a test case?

        Show
        Karl Schaefer added a comment - Does this occur in SwingX 1.6.2? Can you provide a test case?

          People

          • Assignee:
            Karl Schaefer
            Reporter:
            chandanjha
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: