• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hypothetical of course...

 
ryan headley
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was goofing around yesterday and being the newbie that I am...barely i year java...I thought, "I wonder if I can have a JSP open up a JFrame on a client machine". Then I thought, "I'll bet I can..." so I started messing around.
I did get a window to open, but it opened on the server. How do I get it to open on the client. I figure I needed to do something with opening a socket, etc which I have working somewhat. (I can retrieve the clients IP address and the port on the server to which it is connected, and another port number, getLocalPort from ServerSocket I think....
How do I get a socket open from Server to client to pass the JFrame down, moreover, how do I pass that JFrame to the client....
Thanx
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai ryan,
If you want to show a JFrame on to the client i think it is possible only through an Applet(Very important is the browser in which this applet is running should have the plugins for Swings or you can have an AWT Frame and also use jsp lugin tag)
Once it is ok you can just create a JFrame in any of applet lifecycle methods (eg paint)
And i am sorry to inform you that including any of the containers in an applet is not appreciated.

[This message has been edited by Anoop Krishnan (edited May 15, 2001).]
 
Jayson Falkner
Author
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ryan,
Don't get confused about what a JavaServer Page is. JSP runs on the server to handle a request and generate a response for a client. Applets can run on the client-side through a browser. The two are seperate and distinctly different.
What you can do is have the HTML generated by your JSP use an Applet. This applet can then open a JFrame and continue as you like. The code for the applet in this case would be completely seperate from your JSP.
Jayson Falkner
V.P./CTO, Amberjack Software LLC
Jayson@jspinsider.com
www.jspinsider.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic