How do you get the information to put into the outline? If somebody hands you a tree of data you're most of the way there. Say each node of the tree looks like:
Zat make any sense? You'll have to adjust a bit. I bet your outline has a level "2." so you don't print your root, but 1, 2, 3 are the children of the invisible root. And that's not all exactly
Java.
I assumed a tree of data, and standard output. If you're doing another form of input or maybe a Swing display, nearly everything changes.