Producing a full control flow graph that really takes into account all the language
issues is harder than it looks. Not only do you have to identify what
appears to be the "basic blocks", but you have to identify function calls
(sort of easy, but identifying the target might be harder),
where behind-the-scenes operations such as class initializers can happen.
and to worry about the points where exceptions can occur
and where control goes if an exception does occur.
If you examine most languages carefully, they will also be
clear about ordering of evaluation of computations in expressions,
and this matters if you have two side-effects in an expression;
the control flow should reflect the order (or the non-order,
if it isn't defined).
Maybe you only want an abstraction of the control flow
having the basic blocks and the conditionals. That's
obviously a bit easier.
In either case (simple CFG or full CFG), you need to walk the AST,
at each point having a reference to possible control flow targets
(e.g., for most cases, such as IF statements, there are two flow targets:
the THEN and ELSE clauses). At each node, link that node to the
appropriate control flow target, possibly replacing the flow targets
(e.g., when you encounter an IF).
To do this for the full language semantics of Java (or C) is quite
a lot of work. You may want to simply use a tool that computes this
off-the-shelf.
See http://www.semanticdesigns.com/Products/DMS/FlowAnalysis.html
for what this really looks like.