This is a demo webapp that uses Java EE 7 and GlassFish Server 4.1.1
Part of the source material is adapted from Simon Lissack's Websocket Tutorial.
You can directly clone this project into Netbeans (I'm using version 8.1), and build/run/deploy it on your localhost for testing.
It should work without much trouble unless you're a security freak that blocks all traffic on TCP Port 8080 even on your localhost.
I have incorporated a whole bunch of cool CSS stuff too taken from all the over place (including Twitter, css-tricks, etc.) but feel free to adapt them to your own.