Problem in message dialog box

While using swing, i just put message dialog box to display some important message to the user. I'm using this by importing javax.swing.* in a jsp page. But whenever i'm using this for the first time in a browser, this dialog box is not coming to the front. It only appears at the desktop or any window, behind the browser.

I'm getting this whenever i'm using a newly opened browser window. From second time onwards, it will appear correctly. What might be the possible reason for that. My code for dialog box is,

JoptionPane.showMessageDialog(null,"Invalid username/password");

Please help me in resolving this problem.

[658 byte] By [BENQa] at [2007-11-27 2:41:04]
# 1
tryJoptionPane.showMessageDialog(this,"Invalid username/password");
deepak_cuceka at 2007-7-12 3:04:29 > top of Java-index,Desktop,Core GUI APIs...
# 2
is this working....if u find anyother solution....plz put on
deepak_cuceka at 2007-7-12 3:04:29 > top of Java-index,Desktop,Core GUI APIs...
# 3
it's not working yaar. I'm getting one errror while using "this" instead of "null"
BENQa at 2007-7-12 3:04:29 > top of Java-index,Desktop,Core GUI APIs...