rasen58 rasen58 - 1 year ago 60
Java Question

Is it possible to use a REST or web api in a java Swing application

I have a Swing application that is done except for the web api part.
They have a REST api, but when I was looking at example of using a REST api in java, they all use a java web application, and I can't find any for a desktop swing application.
So is it still possible to do so?

Answer Source

Yes. It is possible.

You can Consume (access and read) a REST web service in Swing desktop application.

You can achieve it using HTTPClient.

An example - http://www.mkyong.com/webservices/jax-rs/restful-java-client-with-apache-httpclient/