Skip to main content

Swing : thread "AWT-EventQueue-0"

3 replies [Last post]
ensemien
Offline
Joined: 2012-12-02
Points: 0

Hello everybodya ,i am new in forum and i am happy to join java community
i have somme probleme with swing
there is the error :

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.get(Unknown Source)
at ma.ismp.gpedagogique.presentation.TableModelEtudiantFly.getEtudiant(TableModelEtudiantFly.java:94)
at ma.ismp.gpedagogique.presentation.UIEtudiant$Mouselistner.mouseClicked(UIEtudiant.java:208)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

whene i clich 'ok' the first time there is no probleme ,but whene i click second time there is error
in attachment my JFrmae
please i need help ; thank you so much :)

AttachmentSize
Capture.PNG34.56 KB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kizipro57

Did you check this line of code already and found out why it's trying to get an element at this wrong index and the best way is to do all this in one frame but i have any other solution .

anthony_p
Offline
Joined: 2006-07-23
Points: 0

Hi ensemien,

What exactly does look unclear to you in the exception message? It says, in plain English, that in TableModelEtudiantFly.java at line 94 you're trying to get an element of an ArrayList at index -1, which is obviously wrong since element indexes start with 0. Did you check this line of code already and found out why it's trying to get an element at this wrong index?

--
best regards,
Anthony

ensemien
Offline
Joined: 2012-12-02
Points: 0

Hi thank you Anthony ,you are right ,effectively the probleme is with TableModelEtudiant i think the List wasn't filled normally .
but what i am doing is create two frames one to submit and onther to display results, in this way i avoid the conflict between lists. the best way is to do all this in one frame but i have any other solution . thank you so much .