I have build a ANTLR3 swing application, My problem is how to display tree of my file in graph My code is like this
Antlr3JavaParser parser = new Antlr3JavaParser(tokens);
CommonTree tree;
try {
tree = (CommonTree) parser.compilationUnit().getTree();
DOTTreeGenerator gen = new DOTTreeGenerator();
StringTemplate st = gen.toDOT(tree);
TextAreaParseTree.setText(st.toString()); // This my text area
} catch (RecognitionException e) {
e.printStackTrace();
return false;
}
which is give me an output like
This is my screeshot application https://www.dropbox.com/s/iulr9htjmn5i441/Stack.png
How Can I make this code to be looked a graph (perhaps an image) like in https://www.dropbox.com/s/i50oq8rir66wvce/DIkitLagi.png
Thank you so much