EvilZone

Programming and Scripting => Java => Topic started by: DreX on September 14, 2014, 04:29:19 PM

Title: AWTException and IOException help
Post by: DreX on September 14, 2014, 04:29:19 PM
Can I put both these lines in my "main" line?

How do I make this to work...so that I can use BufferedImage and my MouseMovement.
Title: Re: AWTException and IOException help
Post by: Deque on September 14, 2014, 05:21:13 PM
You separate several thrown exceptions with a comma:
Code: (java) [Select]
public static void main(String[] args) throws IOException, AWTException {

Alternatively, but usually not recommended, you can define a parent class for throws:
Code: (java) [Select]
public static void main(String[] args) throws Exception {
Title: Re: AWTException and IOException help
Post by: DreX on September 14, 2014, 05:26:20 PM
You separate several thrown exceptions with a comma:
Code: (java) [Select]
public static void main(String[] args) throws IOException, AWTException {

Alternatively, but usually not recommended, you can define a parent class for throws:
Code: (java) [Select]
public static void main(String[] args) throws Exception {

thank you. first one did the trick just fine.