Skip to main content

How to draw on canvas and lwuit?

1 reply [Last post]
abuhmead1987
Offline
Joined: 2010-04-21
Points: 0

Dear Guys,

I developed an app on lwuit 1.3 and I want to draw somthing on canvas when the user press on a button, I mix core J2ME with lwuit (Forms developed on LWUIT, and Canvases extended J2ME canvas) on showing canvas I'm using

javax.microedition.lcdui.Display.getDisplay(mIDlet).setCurrent(new MyCanvas());

Is this a correct way or there are other ways to draw on canvas using LWUIT?

Kind Regards,

Mohammad Abu Hmead

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07
Points: 0

This isn't officially supported by LWUIT and will break for you when moving to RIM, Android or any other platform. You can do that but you will be on your own.

We suggest you port your code to LWUIT since the API is pretty easy to port, just derive Form and override paint(Graphics).