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

Servlet & Swing

Tod Sterben

Joined: May 05, 2003
Posts: 7
I have a Swing app that I need to convert into a servlet (I think & I hope). I don't want to have to convert all of this to HTML.
It has Scroll panes, JPanel, JComboBoxes & JLists.
Also SQL.
Is it possible to have this work?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Swing requires asynchronous communications between the UI components. Servlets are only permitted what HTTP permits, which is synchronous request-response type communications initiated from the client side only.
That's why it's not accurate to refer to server-based UI paradigms as "MVC". And why the Model 2 scheme had to be developed to work around those limitations.
OTOH, if you can convert your app into an applet, the server can send it embedded in a web page to the client computer and the two systems can converse. Subject to all the usual grief that applets subject you to.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Servlet & Swing
It's not a secret anymore!