File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Mixing Swing & HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Mixing Swing & HTML" Watch "Mixing Swing & HTML" New topic

Mixing Swing & HTML

Stefan Elfvinge
Ranch Hand

Joined: Oct 29, 2001
Posts: 52
Is it a poor idea to have, for example, a JOptionPane in the Servletcode. Could it be done?
The problem is that it seems to take forever to execute the servlet(displaying a html-form), and the JOptionPane never "pops" up!!!???

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Not clear what you're asking, but if you expect to embed Swing controls in a servlet, that won't work - servlets have no GUI. Swing (and AWT) are for Applications and Applets.

An IDE is no substitute for an Intelligent Developer.
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
Tim is right -- the only way to do the thing that I think you're asking is to embed an applet tag(whose applet code contains the JOptionPane) in your HTML.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
I agree. Here's the link:
subject: Mixing Swing & HTML
It's not a secret anymore!