Websocket and Java Swing front end
Is it开发者_JAVA技巧 doable to make Websocket interfaced with Java Swing front end? If so how?
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.
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
精彩评论