How to remove the screen dimming when is presented dialog?

188 views Asked by At

I want to be able to press the other buttons on my screen when open dialog.

Dialog menuDialog = new Dialog("Dialog Demo");
menuDialog.setTimeout(1000);
menuDialog.show(90, 90, 10, 10, true);
2

There are 2 answers

0
Vimal On

Whilst 'pheromix' is correct in associating an action to the pointerReleased region. You would also need to make setDisposeWhenPointerOutOfBounds(false) in the derived Dialog class.

You can also refer the detailed explanation here http://www.java.net/forum/topic/mobile-embedded/lwuit/how-remove-screen-dimming-when-presented-dialog-2

0
pheromix On

Don't use directly a Dialog but create a class which derives Dialog. Implement the pointerReleased method , assuming that the device is tactile , and test if the x and y params are contained inside the area delimited by the Buttons's coordinates :

if ( ( x >= btn.getAbsoluteX() && x <= btn.getAbsoluteX() + btn.getPreferredW() ) && ( y >= btn.getAbsoluteY() && y <= btn.getAbsoluteY() + btn.getPreferredH() ) )
   // execute the Buttons's action method
else
   super.pointerReleased(x,y);