import statement throws exception
843805Nov 28 2005 — edited Nov 28 2005Hey,
I just added the code into my program to have a tray icon as is now supported in Java 1.6.0 "Mustang". Really easy and straight forward to do.
Trouble is that the program will throw an exception if run on 1.4.2 or 1.5.0. The icon is a convenience not a necessity so I want to be able to allow the program to run on any of these platforms.
Is there a way to import the classes other than using the import command and allow the program to catch the exception and respond with something like JOptionPane.showmessagedialog(frame,"Upgrade to Mustang to have tray icon");
I thought about catching the exception when the class with the import statements is called, but that would cause the object to be null and would cause NullPointerExceptions all over my application.
Any suggestions?
Thanks,
DAvid