Skip to first unread message

Adejuwon Omolara

unread,
Aug 26, 2013, 8:02:00 AM8/26/13
to codenameone...@googlegroups.com
Hello. I have been trying to lay my hands on why the dlgRight.show() line has been throwing an error (arrayindexoutofboundsexception 0>=0) and I dont seem to get the reasons. Any kind of help will be appreciated.

The snippet shows how it has been declared
 
                                Label rightLabel = new Label(right);
                                Dialog dlgRight = new Dialog("CORRECT");
                                dlgRight.addComponent(rightLabel);
                                dlgRight.setTimeout(1000);
                                dlgRight.show();
                                showForm("DisplaySim", null);


Chen Fishbein

unread,
Aug 26, 2013, 8:50:11 AM8/26/13
to codenameone...@googlegroups.com
Your code seems fine, can you post the full stacktrace? it would help us understand what went wrong

Adejuwon Omolara

unread,
Aug 26, 2013, 10:57:28 AM8/26/13
to codenameone...@googlegroups.com
The following lines are the log on the console:


java.lang.ArrayIndexOutOfBoundsException: 0 >= 0
at java.util.Vector.elementAt(Vector.java:470)
at com.codename1.ui.Form.loopAnimations(Form.java:958)
at com.codename1.ui.Form.repaintAnimations(Form.java:950)
at com.codename1.ui.Display.edtLoopImpl(Display.java:933)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1059)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1094)
at com.codename1.ui.Form.showModal(Form.java:1398)
at com.codename1.ui.Dialog.showModal(Dialog.java:1075)
at com.codename1.ui.Form.showDialog(Form.java:1422)
at com.codename1.ui.Form.showModal(Form.java:1409)
at com.codename1.ui.Dialog.showImpl(Dialog.java:1033)
at com.codename1.ui.Dialog.show(Dialog.java:1017)
at userclasses.StateMachine$5.actionPerformed(StateMachine.java:329)
at com.codename1.ui.util.EventDispatcher.fireActionSync(EventDispatcher.java:383)
at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:326)
at com.codename1.ui.Button.fireActionEvent(Button.java:376)
at com.codename1.ui.Button.released(Button.java:407)
at com.codename1.ui.Button.pointerReleased(Button.java:495)
at com.codename1.ui.Form.pointerReleased(Form.java:2132)
at com.codename1.ui.Form.pointerReleased(Form.java:2079)
at com.codename1.ui.Component.pointerReleased(Component.java:2279)
at com.codename1.ui.Display.handleEvent(Display.java:1720)
at com.codename1.ui.Display.edtLoopImpl(Display.java:924)
at com.codename1.ui.Display.mainEDTLoop(Display.java:858)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:119)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:177)


Thank you

Chen Fishbein

unread,
Aug 26, 2013, 11:11:54 AM8/26/13
to codenameone...@googlegroups.com
Hi,
The stack trace indicates your local libs are out of date, can you please update your local libs and try again.
go to "project properties"->"Update Project libs" 


Adejuwon Omolara

unread,
Aug 26, 2013, 2:18:04 PM8/26/13
to codenameone...@googlegroups.com
Thank you. I tried updating and the return message was that it is already up to date. Though I have refreshed.

Best Regards,

Adejuwon Omolara


--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/l23WdXob3AM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/a456fa70-f455-4a16-9665-3a927da36130%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Shai Almog

unread,
Aug 26, 2013, 11:59:58 PM8/26/13
to codenameone...@googlegroups.com
Are you changing things in a separate thread?
Can you turn on the EDT violation detection switch in the simulator?
What do you have around line 329 within your state machine class?

Adejuwon Omolara

unread,
Aug 27, 2013, 3:18:20 AM8/27/13
to codenameone...@googlegroups.com
I am not using a thread. The code on the line 329 is the dlgRight.show();

Best Regards,

Adejuwon Omolara


--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/l23WdXob3AM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

Shai Almog

unread,
Aug 27, 2013, 1:31:32 PM8/27/13
to codenameone...@googlegroups.com
You can be on a separate thread by using a timer or networking and quite a few other things.
Its just really hard to understand what you are doing to reach this point? What do you have in that area? What else is executing?
Reply all
Reply to author
Forward
0 new messages