Author Topic: AWTException and IOException help  (Read 1419 times)

0 Members and 1 Guest are viewing this topic.

Offline DreX

  • Serf
  • *
  • Posts: 42
  • Cookies: -5
    • View Profile
AWTException and IOException help
« 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.
« Last Edit: September 14, 2014, 04:29:37 pm by DreX »

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: AWTException and IOException help
« Reply #1 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 {
« Last Edit: September 14, 2014, 05:22:40 pm by Deque »

Offline DreX

  • Serf
  • *
  • Posts: 42
  • Cookies: -5
    • View Profile
Re: AWTException and IOException help
« Reply #2 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.