views:

271

answers:

1

I am displaying a dialog when a user touches the screen and want the dialog to dispose when the user touches anywhere outside the dialog.i have set setDisposeWhenPointerOutOfBounds() to true though by default it is...n hav written the following code in pointerReleased() event but whenever the user touches the screen outside of dialog the dialog disposes but not without executing the code that shud be executed only wen the x,y are within the dialog....plz help me out....ne1...

public void pointerReleased(int x, int y) { dispose(); if (contains(x, y)) { actionCommand((cmds[l.getSelectedIndex()])); } }

A: 

the bug was in checking contains(x,y)...i replaced it with [this.getContentPane.contains(x,y)] ...its done buddies..

MANISH