• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to close a JOptionPane in a Servlet  RSS feed

 
Marilyn de Queiroz
Sheriff
Posts: 9080
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I press the "About" button in the HTML page, it takes me to AboutServlet which consists of a JOptionPane containing the "About the Application" text. The problem is that when I close the About dialog box, it appears to go away, but in reality it is still there in the background.

How can I get rid of it without using System.exit() which will shut down everything and not just the dialog box?
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm baffled by this. Are you really opening up a Swing GUI window in a servlet, or is an applet in the browser opening it, or is it a Javscript window?
If you are using Swing (or any other GUI API) in your servlet, then you are in for a big headache if you try to access the servlet from a different machine. What use is a window which appears on the screen of the server?
Please let us know a bit more about what you want to happen, and how you are approaching it at the moment.
 
Marilyn de Queiroz
Sheriff
Posts: 9080
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Frank. That clarifies matters. Since I was using localhost, I didn't realize that it was showing up on the server screen rather than the client screen. It seems the thing to do is to create an applet to show the "about the application" information.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!