• Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane (is a!)

 
Jon Nicks
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using the above component to prompt users for unentered fields using JSPs and a standard web browser. Within the JSP bean I code the JOptionPane to present a window asking for a mandatory field to be entered like so:
JOptionPane.showMessageDialog(null, "Please enter Title.", "Missing Title.", JOptionPane.INFORMATION_MESSAGE );
The environment I use is VisualAge with the Websphere Test Environment.
Although the window is displayed, it is in the background of the browser initially and I have to 'alt-tab' to see it. On subsequent executions however, the window is in the foreground.
My question is , is there a simple way to prioritise the JOptionPane so it is always in the foreground? (I've also tried this using Websphere Application Server and the JSP will just hang when trying the JOptionPane). Am I using the right component?
Any pointers would be most appreciated.
Thanks,
Jon.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would bet that it is showing up in the background because you are passing null as the parent for the dialog. showMessageDialog() opens a modal dialog, so it would be on top by default, but it seems that it doesn't know what to be on top of. To be honest, I'm not sure how to get around this for a bean.
 
Jon Nicks
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bodie.
Beans are just really references to a class containing the necessary interacting methods etc. to the database, so I guess I'll need to declare the calling class as the parent?
I'll give that a whirl, thanks again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!