Results 1 to 3 of 3
  1. #1
    justbeller is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

    Post Exception in JTable

    Hello Every one
    Im getting error in Jtable when I selecting the row & then i using clearSelection() I got this exception

    please help me


    Exception occurred during event dispatching:
    java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.Vector.elementData(Vector.java:707)
    at java.util.Vector.elementAt(Vector.java:450)
    at SearchingFrame.valueChanged(SearchingFrame.java:17 3)
    at javax.swing.DefaultListSelectionModel.fireValueCha nged(DefaultListSelectionModel.java:184)
    at javax.swing.DefaultListSelectionModel.fireValueCha nged(DefaultListSelectionModel.java:164)
    at javax.swing.DefaultListSelectionModel.fireValueCha nged(DefaultListSelectionModel.java:211)
    at javax.swing.DefaultListSelectionModel.changeSelect ion(DefaultListSelectionModel.java:405)
    at javax.swing.DefaultListSelectionModel.changeSelect ion(DefaultListSelectionModel.java:415)
    at javax.swing.DefaultListSelectionModel.removeSelect ionIntervalImpl(DefaultListSelectionModel.java:576 )
    at javax.swing.DefaultListSelectionModel.clearSelecti on(DefaultListSelectionModel.java:420)
    at javax.swing.JTable.clearSelection(JTable.java:2054 )
    at javax.swing.JTable.clearSelectionAndLeadAnchor(JTa ble.java:2062)
    at javax.swing.JTable.tableChanged(JTable.java:4322)
    at javax.swing.JTable.setModel(JTable.java:3640)
    at SearchingFrame.actionPerformed(SearchingFrame.java :162)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:2012)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2335)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:404)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:253)
    at java.awt.Component.processMouseEvent(Component.jav a:6099)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3287)
    at java.awt.Component.processEvent(Component.java:586 4)
    at java.awt.Container.processEvent(Container.java:210 9)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4460)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2167)
    at java.awt.Component.dispatchEvent(Component.java:42 86)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4465)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4129)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4059)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2153)
    at java.awt.Window.dispatchEventImpl(Window.java:2554 )
    at java.awt.Component.dispatchEvent(Component.java:42 86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 604)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:275)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:200)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:194)
    at java.awt.Dialog$1.run(Dialog.java:1072)
    at java.awt.Dialog$3.run(Dialog.java:1126)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Dialog.java:1124)
    at java.awt.Component.show(Component.java:1455)
    at java.awt.Component.setVisible(Component.java:1407)
    at java.awt.Window.setVisible(Window.java:870)
    at java.awt.Dialog.setVisible(Dialog.java:1011)
    at SearchingFrame.setVisible(SearchingFrame.java:148)
    at MainFrame.actionPerformed(MainFrame.java:483)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:2012)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2335)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:404)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton. java:374)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Bas icMenuItemUI.java:1688)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mou seReleased(BasicMenuItemUI.java:1732)
    at java.awt.Component.processMouseEvent(Component.jav a:6099)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3287)
    at java.awt.Component.processEvent(Component.java:586 4)
    at java.awt.Container.processEvent(Container.java:210 9)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4460)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2167)
    at java.awt.Component.dispatchEvent(Component.java:42 86)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4465)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4129)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4059)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2153)
    at java.awt.Window.dispatchEventImpl(Window.java:2554 )
    at java.awt.Component.dispatchEvent(Component.java:42 86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 604)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:275)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:200)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:185)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:177)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:138)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    Have you respected Swing's single threaded rule?
    Threads and Swing
    The Last Word in Swing Threads
    Lesson: Concurrency in Swing (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

    db

  3. #3
    justbeller is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

Similar Threads

  1. Replies: 5
    Last Post: 02-14-2011, 11:39 PM
  2. Replies: 1
    Last Post: 02-06-2011, 05:38 AM
  3. Replies: 9
    Last Post: 08-22-2010, 04:44 PM
  4. Replies: 2
    Last Post: 05-15-2008, 10:15 AM
  5. Replies: 1
    Last Post: 03-08-2008, 06:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •