Help converting Swing applet to Vaadin

Hello again everyone,

I’m stuck on this problem and hopefully someone can shed some light. I’ve looked over the forums and the AppletIntegration code, but I can’t immediately see how it applies to this situation.

I have some working code example that creates an applet and shows the applet in a JFrame, and I want to implement this functionality into our Vaadin application. Basically, the applet takes a tree structure, builds a JUNG graph with interactivity, and adds that graph’s visualization to a JFrame. The applet is not packaged as a jar, but rather implemented as an inner class.

Can someone point me in the right direction on how this might be implemented in Vaadin? I’ve included some code to show you how the JFrame is created to kick start some discussion and included an example image of what is produced by the code.

Thanks for your help!

    TreeApplet applet = new TreeApplet(rdpNodes);
    JFrame frame = new JFrame();
    Container content = frame.getContentPane();

private class TreeApplet extends JApplet {

    private TreeApplet(ArrayList<RdpEntry> rdpNodes) {
        Forest<RdpEntry, Integer> graph = new DelegateForest<RdpEntry, Integer>();
        int i = 0;
        for (RdpEntry r : rdpNodes) {
            if (r.hasChildren()) {
                for (RdpEntry child : r.getChildren()) {
                    graph.addEdge(i, r, child);
        RadialTreeLayout<RdpEntry, Integer> radialLayout = new RadialTreeLayout<RdpEntry, Integer>(graph);
        radialLayout.setSize(new Dimension(800, 800));
        VisualizationViewer<RdpEntry, Integer> vv = new VisualizationViewer<RdpEntry, Integer>(radialLayout, new Dimension(800, 800));
        RadialTreeRings rings = new RadialTreeRings(graph, radialLayout, vv);
        vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line());
        vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<RdpEntry>());
        vv.setVertexToolTipTransformer(new ToStringLabeller());
        vv.getRenderContext().setArrowFillPaintTransformer(new ConstantTransformer(Color.lightGray));
        vv.setGraphMouse(new DefaultModalGraphMouse());
        GraphZoomScrollPane panel = new GraphZoomScrollPane(vv);
        Container content = getContentPane();


If you want it to be interactive, it would require an awful lot of work, unless you find a suitable GWT library.
If it doesn’t have to be interactive, the easiest way will be to render images using JUNG and display them using Embedded component.

Thanks Michal. Unfortunately, as you can see from the example image, they can be sort of unwieldy and large and almost requires the ability, given by the applet, to zoom and navigate. I’ll look around for another way to do this, but it would be a huge bummer if this was impossible.

Take a look at these gwt libraries:

They are both wrappers around javascript graph visualisation frameworks
Examples for first one look promising:
Wrapper projects are very young, but you may try to evolve it and create comprehensive vaadin component.

Also, you could use processingJS (
Processing is very powerfull tool for visualisations, but i don’t know of any existing graph framework for it.

These demos
really look amazing. I hope someone would create a Vaadin wrapper for these :)

If I ever want to finish my PhD, I’d probably not have time to do this myself. Would a good starting point be