Open GoogleCodeExporter opened 9 years ago
On some further testing on simulator, I am getting the following error when
using the Esc key to go back to previous form. This might be related to the
above error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.codename1.impl.javase.JavaSEPort$8.actionPerformed(JavaSEPort.java:1244)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:95)
at java.awt.MenuItem.processActionEvent(MenuItem.java:650)
at java.awt.MenuItem.processEvent(MenuItem.java:609)
at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:343)
at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:331)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:663)
at java.awt.EventQueue$2.run(EventQueue.java:661)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:677)
at java.awt.EventQueue$3.run(EventQueue.java:675)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:674)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
An exception occurred during transition paint this might be valid in case of a
resize in the middle of a transition
An exception occurred during transition paint this might be valid in case of a
resize in the middle of a transition
java.lang.ArrayIndexOutOfBoundsException: 1 > 0
at java.util.Vector.insertElementAt(Vector.java:551)
at com.codename1.ui.Container.insertComponentAt(Container.java:407)
at com.codename1.ui.Container.addComponent(Container.java:426)
at com.codename1.ui.MenuBar.addCommand(MenuBar.java:992)
at com.codename1.ui.Form.addCommand(Form.java:2051)
at com.codename1.ui.util.UIBuilder.initBackForm(UIBuilder.java:1861)
at com.codename1.ui.util.UIBuilder.showForm(UIBuilder.java:2060)
at com.codename1.ui.util.UIBuilder.showContainerImpl(UIBuilder.java:2018)
at com.codename1.ui.util.UIBuilder.showContainer(UIBuilder.java:1902)
at com.codename1.ui.util.UIBuilder$FormListener.actionPerformed(UIBuilder.java:2406)
at com.codename1.ui.util.EventDispatcher.fireActionSync(EventDispatcher.java:366)
at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:311)
at com.codename1.ui.Form.actionCommandImpl(Form.java:1156)
at com.codename1.ui.Form.actionCommandImpl(Form.java:1131)
at com.codename1.ui.MenuBar.keyReleased(MenuBar.java:1274)
at com.codename1.ui.Form.keyReleased(Form.java:1658)
at com.codename1.ui.Display.handleEvent(Display.java:1625)
at com.codename1.ui.Display.edtLoopImpl(Display.java:906)
at com.codename1.ui.Display.mainEDTLoop(Display.java:853)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:119)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:171)
Original comment by nir...@nvsoft.com
on 13 Oct 2012 at 1:20
While I can fix this exception I don't think this will produce the behavior you
want.
Since you want to navigate back you need to invoke the back method and not
invoke show.
When you invoke showForm you automatically add a new form to the navigation
stack which means that the UIBuilder is trying to insert a back command into
your home screen (probably not what you want).
Original comment by shai.almog
on 13 Oct 2012 at 5:49
Hi Shai,
Actually on the press of this button, I want to go back to the Home
screen. And when that home form is shown, I want to have the back
transition effect to that form. Also I thought, when we show the
homeForm, the navigation stack will be cleared.
What do you suggest, the best way to achieve the following:
Starting from a home form, I have a couple of forms which the user
goes through to a final form. Once in the final form, when user
presses (hardware back or Home button), he should go back to the home
form. The in-between forms would have the normal back navigation,
however once we reach the final screen, there is no need to go back to
the previous forms, but directly to the home screen.
Original comment by nir...@nvsoft.com
on 15 Oct 2012 at 6:41
I see what you mean, I have a fix for this. Will be up in the next update.
Original comment by shai.almog
on 15 Oct 2012 at 12:04
Hi Shai,
FYI: this also happens even if you do not call showForm() explicitly, but just
use the hardware back button. Here's the stack trace for it:
java.lang.ArrayIndexOutOfBoundsException: 1 > 0
at java.util.Vector.insertElementAt(Vector.java:551)
at com.codename1.ui.Container.insertComponentAt(Container.java:407)
at com.codename1.ui.Container.addComponent(Container.java:426)
at com.codename1.ui.MenuBar.addCommand(MenuBar.java:992)
at com.codename1.ui.Form.addCommand(Form.java:2051)
at com.codename1.ui.util.UIBuilder.initBackForm(UIBuilder.java:1861)
at com.codename1.ui.util.UIBuilder.showForm(UIBuilder.java:2060)
at com.codename1.ui.util.UIBuilder.showContainerImpl(UIBuilder.java:2018)
at com.codename1.ui.util.UIBuilder.showContainer(UIBuilder.java:1902)
at com.codename1.ui.util.UIBuilder$FormListener.actionPerformed(UIBuilder.java:2406)
at com.codename1.ui.util.EventDispatcher.fireActionSync(EventDispatcher.java:366)
at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:311)
at com.codename1.ui.Form.actionCommandImpl(Form.java:1156)
at com.codename1.ui.Form.actionCommandImpl(Form.java:1131)
at com.codename1.ui.MenuBar.keyReleased(MenuBar.java:1274)
at com.codename1.ui.Form.keyReleased(Form.java:1658)
at com.codename1.ui.Display.handleEvent(Display.java:1625)
at com.codename1.ui.Display.edtLoopImpl(Display.java:906)
at com.codename1.ui.Display.mainEDTLoop(Display.java:853)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:119)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:171)
Original comment by nir...@nvsoft.com
on 16 Oct 2012 at 5:22
Original issue reported on code.google.com by
nir...@nvsoft.com
on 13 Oct 2012 at 12:21