This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Since this doesn't have anything specifically to do with Swing/JFC/AWT GUI stuff, I'm moving this post to the Java In General (Beginner) forum.
(In addition, this sounds suspiciously like a homework problem... and there's a difference between asking "Give me some suggestions/hints/pointers on how to do X" and "Post the code for X so I can cut and paste it into my homework". I'll give a hint... this involves loops and methods on the String class.)
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
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