日期:2014-05-20  浏览次数:20796 次

Lwuit的高手请给我指点一下!
java.lang.IllegalArgumentException: Component is already contained in Container: Container[x=0 y=42 width=240 height=211, layout = FlowLayout, scrollableX = false, scrollableY = true, components = [Label, TextField, Label, TextField, Label]]
at com.sun.lwuit.Container.insertComponentAt(+36)
at com.sun.lwuit.Container.addComponent(+22)
at com.sun.lwuit.Form.addComponent(+8)
at com.*********.client.LoginForm.<init>(+154)
at com.*********.client.MainForm.actionPerformed(+20)
at com.sun.lwuit.util.EventDispatcher.fireActionSync(+24)
at com.sun.lwuit.util.EventDispatcher.fireActionEvent(+92)
at com.sun.lwuit.Form.actionCommandImpl(+68)
at com.sun.lwuit.Form.actionCommandImpl(+13)
at com.sun.lwuit.MenuBar.actionPerformed(+128)
at com.sun.lwuit.util.EventDispatcher.fireActionSync(+24)
at com.sun.lwuit.util.EventDispatcher.fireActionEvent(+92)
at com.sun.lwuit.Button.fireActionEvent(+82)
at com.sun.lwuit.Button.released(+11)
at com.sun.lwuit.Button.released(+6)
at com.sun.lwuit.MenuBar.keyReleased(+125)
at com.sun.lwuit.Form.keyReleased(+27)
at com.sun.lwuit.Display.handleEvent(+93)
at com.sun.lwuit.Display.edtLoopImpl(+118)
at com.sun.lwuit.Display.mainEDTLoop(+208)
at com.sun.lwuit.RunnableWrapper.run(+245)
病情是这样子的:小弟做的是Lwuit的应用,做的时候是在Form之间跳转的,当菜单Form跳到第二个Form时不会出现问题,当从第二个Form跳到菜单Form时也没问题,但是再从菜单Form跳到第二个Form时,问题就出现了以上的问题!接触Lwuit不久,不知道哪里出了问题!我知道他说容器中包含了原来的那个Form,两个有冲突,可是我不知道怎样写就没有冲突了,也不知道是不是和布局有关系,希望遇到过这种问题的高手帮忙解决一下,或者说说您是怎样实现页面跳转的!谢谢……

------解决方案--------------------
你是不是定义了两个容器啊。。建议先一部一部分的实现,看到底出现在哪一行。。
------解决方案--------------------
不懂。帮顶