Well some more information would be useful. I don't believe there is any graph drawing capability built into the standard java api, so you've either written the code yourself in which case only you know the answer to the question or you are using a 3rd party api in which case you need to look at the documentation for that. If you are using a 3rd party api then if you tell us which one it is, someone else may have used it and may be able to help you.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com