The screenshots below provide links to the actual applications, on the left the applet, on the right the JWt application:

The same AWT graphics rendering logic is now used by both the desktop and web version.

The trick to this conversion was the implementation of WebGraphics2D class, available in JWt git version. This implements the java.awt.Graphics2D interface using JWt’s WPainter which has backends for the common web-based graphics formats (HTML5 canvas, SVG and VML).

Using this class we created a JWt widget (TreeWidget) which wraps a Swing component (TreePane). The following could actually serve as a generic way of wrapping a JComponent in a WPaintedWidget.