HOW TO FIX IT: It is because eventhough you have Java 5 installed, the JVM running may be different. Try typing this in the console window: java -version. It will give you the Version of the Runtime Environment. Or, if you are using an IDE, then you need to enable Java 5 support. In Eclipse, You can add Java 5 in Window > Preferences > Java > Installed JRE’s. and/or, Set the compiler compliance level to 5.0 (Window > Preferences > Java > Compiler) In Netbeans, you can use (Tools -> Java Platform Manager) to check your default platform. If you use javac commond line, try: javac -1.5 xxx.java Reference: http://laksmono.wordpress.com/2007/05/27/syntax-error-parameterized-types-are-only-available-if-source-level-is-50/
When SwingWorker is used to report task progress, it should be noted that the propertyChangeEvent won't be invoked if the oldValue is the same as the oldValue. To solve this problem, it is better to reset your progress status to zero or random number before the SwingWorker starts. The setting will force the propertyChangeEvent to be invoked. So your progress status will be updated.
Comments