Skip to main content

Is This LWUIT Bug ?

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

Dear Guys,

I created app with multiple forms, each form inherited fromForm class and in seperate class file. When i tried to override it's paintBackground by drawing red line (0,0,width,height), When I show this form previous form i saw the previous form contents in the current form background and the line drawn and shown.

I hoped it's problem in my code, and I edited MainScreenForm paintBackground method in LWUIT 4 demo but I found the same result!!!!

public void paintBackground(Graphics g) {

g.drawLine(0, 0, getWidth(), getHeight());


All of you try this.

Does it affect on memory?Heap?

So, why the Form in LWUIT didn't has dispose method?

Reply viewing options

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


LWUIT clears the screen in paintBackground for opaque components which you blocked by not calling super, that doesn't mean the form is still in memory. It just means the screen buffer has artifacts on it.

In fact it means that LWUIT is very efficient since it doesn't draw over areas that aren't modified.