views:

233

answers:

2

Is it doable to make Websocket interfaced with Java Swing front end? If so how?

A: 

Kaazing WebSocket Gateway ships with support for JavaScript, Flex, Silverlight, but also native Java clients (stand alone as well as applets). For more information, check out http://tech.kaazing.com/documentation/index.html

Peter Lubbers
A: 

Try mine:

http://github.com/TooTallNate/Java-WebSocket

Contains a Client and Server implementation. In the example folder there's a simple JFrame subclass called ChatClient. Look at it's source for a Swing reference.

Essentially you just need to subclass net.tootallnate.websocket.WebSocketClient and implement the onOpen, onClose, and onMessage methods. The class has an interface very similarly to the WebSockets API for HTML5.

TooTallNate