wikiacademia

site
A label renderer is the most basic renderer factory. It simply displays a specified datafield as the node label. First thing to do is to create the labelrenderer, specifying the datafield to be displayed as the label.
LabelRenderer tr = new LabelRenderer("Name");
After the renderer has been created, there are a variety of options for tweaking the appearance and position of the node. A full list of these options can be found in the prefuse API documentation, but the example given gives the nodes rounded corners with the arc width and height of 8 :
tr.setRoundedCorner(8,8);

Finally, the renderer factory should be registered with the visualization using the setRendererFactory() function. A new renderer factory is created with the label renderer previously created.
viz.setRendererFactory(new DefaultRendererFactory(tr));