Hi Simon,

I'm using the code that you posted to us all
==========
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.swing.JOptionPane.*; public class SomeServlet extends HttpServlet {
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
        PrintWriter out = response.getWriter();
        String display;
        display = JOptionPane.showInputDialog("enter name");
        out.println("bla bla bla " +display );
        }
}
==========

Here's what I think happens:
-> We contact the servlet from whereever.
-> The servlet code begins to execute
-> Among other classes, the JOptionPane is asked to popup.
-> It therefore pops up, on the server, and when you type some stuff and click OK, the 
return value is stored in the String called display.
        Please note that we are still at the server.
-> The servlet then executes the next piece of code, which send "bla bla bla" and the 
contents of the display String object to the web browser.

So, what happens here is a person sitting at the server could then feed in different 
stuff for different users, though I can't imagine such a requirement. An what if lots 
of
users started to contact the server at the same time ?

Unfortunately, this is not what a number of us have thought it to be, i.e. send Swing 
UIs to the browser !

One way to achieve this would be to send applets to the browser, and then these 
applets launch Swing UIs, and these Swing UI's then communicate with the servlets.

Regards,

Sriram

5/20/01 9:34:00 PM, Simon Chia <[EMAIL PROTECTED]> wrote:

>nd why would you say that? i'm not so sure myself about this stuff also. plz
>let me know more!
>
>----- Original Message -----
>From: "James Klicman" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Saturday, May 19, 2001 7:11 PM
>Subject: Re: I'm amazed myself ! -> Re: Servlet with Swing
>
>
>> That would be a pretty cool trick. :-) Unfortunately, the servlet must
>> be running on the same computer as the browser or sneaking through X11.
>>
>> This is definitely not Servlet<->HTTP<->Browser communication.
>>
>> -James
>>




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to