I was building a java desktop application from few days and all was going well.
But today, when I opened the Netbeans and compiled a file, the following compilation error occrured:
Compiling 9 source files to C:\Documents and Settings\Administrator\Desktop\EMS\build\classes
C:\Documents and Settings\Administrator\Desktop\EMS\src\ems\EMSAboutBox.java:7: package org.jdesktop.application does not exist
import org.jdesktop.application.Action;
C:\Documents and Settings\Administrator\Desktop\EMS\src\ems\EMSApp.java:7: package org.jdesktop.application does not exist
import org.jdesktop.application.Application;
C:\Documents and Settings\Administrator\Desktop\EMS\src\ems\EMSApp.java:8: package org.jdesktop.application does not exist
import org.jdesktop.application.SingleFrameApplication;
C:\Documents and Settings\Administrator\Desktop\EMS\src\ems\EMSApp.java:13: cannotfind symbol
symbol: class SingleFrameApplication
public class EMSApp extends SingleFrameApplication {
C:\Documents and Settings\Administrator\Desktop\EMS\src\ems\EMSView.java:7: package org.jdesktop.application does not exist
import org.jdesktop.application.Action;
C:\Documents and Settings\Administrator\Desktop\EMS\src\ems\EMSView.java:8: package org.jdesktop.application does not exist
import org.jdesktop.application.ResourceMap;
C:\Documents and Settings\Administrator\Desktop\EMS\src\ems\EMSView.java:9: package org.jdesktop.application does not exist
I was using the same code before but no error occured like this. When I checked the libraries, then the org.jdesktop.application package is there and when we import that package, the netbeans show the "application" package in suggestion.
Then why the error is there when the package is already there. If the package was not in the library, then Netbeans would have shown a red line under the import statement, but it is not showing that red line too.
Where is the problem?
NetBeans has these habit of spontaneously screwing things. Clean your project and rebuild it afresh.
If it doesn't help, clean your workspace.
I had the same problem. It wasn't problem with netbeans cache or something similar.
My project depended on some Swing package which was needed to install.
Right click on project > Click on Resolve project problems, now just install missing package and problem is solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With