This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Mixing Swing & HTML" Watch "Mixing Swing & HTML" New topic
Author

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!!!???


Steffe
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17149
    
  27

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
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mixing Swing & HTML
 
jQuery in Action, 3rd edition