0

I had declared and implemented a class (1) in a package , then imported (2) and used (3) in another class file of the same package but not folder :

1 - class file MIkController has no problem or warning

2 - import pro.gcon.mik.controller.MIkController;

3 - public void setController(MIkController miKController) { #body }

Class MIkController is in package pro.gcon.mik.controller , while the class file where i need to use MIkController is in package pro.gcon.mik.view .
Everything worked until i closed NetBeans , the next time i had found that the import (2) appeared as not used and it tells me that the declared function (3) needs one class , enum , etc. I've tried to found an answer but I have not found anything that is right for my problem. Sorry for my school English and thanks in advance for your reply.

  • Have you tried compiling with javac directly? If that works then it's an issue with the IDE/project setup rather than the code in file (3). – polo-language Jan 10 '22 at 12:43
  • Also, try commenting out the import and instead use the fully qualified class name everywhere it appears in the file. If you're seeing a problem after doing that, it may be for example that you're using a different version of the imported class than intended. – polo-language Jan 10 '22 at 12:47
  • I tried the fully qualified name and the javac compiling but nothing change (javac : invalid flag) , for the second one i don't know but i have only 6 files divided in 3 folder , all of that with different names like MIkPanel , ButPanel or MIField . – Giacomo Lattanzi Jan 11 '22 at 17:53

0 Answers0