This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes swing concept Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "swing concept" Watch "swing concept" New topic
Author

swing concept

kalpana kp
Greenhorn

Joined: Sep 07, 2006
Posts: 12
how to connect swing to servlet?I create textfield in swings.how to pass this text field value to servlet.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Welcome to the Ranch!

Firstly you would not send a textfield to a servlet, you would send the data (or text). Also, it doesn't matter that the end point is a servlet, you are just sending it across HTTP.

Now you just need to work out how to get a Swing application to send data across the web. Check out the HTTP Client in the Apache Commons libraries in http://jakarta.apache.org

Dave
kalpana kp
Greenhorn

Joined: Sep 07, 2006
Posts: 12
hi there

Just i need how to pass data from swings(i:e swing Jtextbox) to servlet or jsp
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

David has answered your question.
Swing is desktop technology and servlets are server technology.
If they are to communicate it will have to be over HTTP.

The easiest way is to make your swing app a web client.
The easiest way to do that is to use the libraries in the link that David has already given you.


Check out the HTTP Client in the Apache Commons libraries in http://jakarta.apache.org


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
kalpana kp
Greenhorn

Joined: Sep 07, 2006
Posts: 12
Hi there thanks for advising use libraries but how to use?give me sample code for passing date from swing to servlet
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

No problems. You just need this and this.

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: swing concept