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.
"ouch". Yes, it will work, but because it is a checked Exception it requires a "throws" or a "try-catch." Go into your Java folder on your PC, and explore it until you find a file called src.zip. Unzip that, find a method which throws an Exception, and examine that. Find the java folder, in that the awt folder, in that the Color class, then inspect its constructors. See how they deal with Exceptions. Have a look at the Java Tutorial here.
Joined: Oct 13, 2005
I really ought to learn to read. I see you already have a try-catch, but not a "throws." You ought not to catch "Exception," but a subclass on Exception. When I said "method which throws Exceptions" the constructor I quoted is a similar example.
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