Skip to main content

How to draw on canvas and lwuit?

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2010-04-21

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.
Joined: 2003-11-07

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).