原文:
Success! LWUIT on Blackberry
Posted by wsnyder6 on July 09, 2008 at 03:41 PM | Comments (20)
This will be short and sweet.
To work around a race condition (see this thread), LWUIT needs to run on a separate thread on the Blackberry. Taking this into effect, together with a modified LWUIT distribution (removing references to M3G helper classes and the 3D Transition classes), I've finally got the demo to work on a simulator.
Granted, this in the JDE, not NetBeans. I need to figure that out yet. In the JDE, make sure you have the modified LWUIT dist set up as a library type project, and then make your a LWUIT midlet project dependent on that library.
Oh yeah, since LWUIT really relies on the presence of soft keys, you may want to use the BlackBerry UiApplication class to catch key events and wheel events, then translate those to the corresponding UI action. But you can also keep the same q/w and o/p softkeys in place.
Proof that it works!
翻译:
LWUIT成功运行在黑莓上!
这将是短暂而甜蜜的。
要解决这个问题(见本线),LWUIT需要运行在黑莓的一个独立的线程。考虑到这一点的影响,加上修改LWUIT分配(删除涉及M3G等帮助类和3d过渡类),我终于完成了在模拟器上工作的Demo。
当然,这是在JDE,而不是NetBeans的。我依然需要指出。在JDE里面,确认你修改的LWUIT在项目中以库的形式设立,然后让你的LWUIT midlet项目依赖于这个库。
噢,LWUIT真正的存在依靠软键,您可能会想要使用BlackBerry UiApplication类捕捉按键事件和滚轮事件,然后把这些转换为相应的UI动作。但您也可以保留相同的q/w和o/p软键代替。
下面是它的运行效果!