1

I have the following structure for my java project:

-src
    -(default package)
       -Calculator.java
       -AnotherClass.java
       -EvenOneMoreClass.java
       -ui
         -MainWindow.java

I know I can include main window in Calculator with import ui.MainWindow. How do I import AnotherClass.java into MainWindow.java?

Or, is my structure just wrong for how I want this to work?

Sotirios Delimanolis
  • 263,859
  • 56
  • 671
  • 702
intboolstring
  • 6,519
  • 4
  • 28
  • 42

1 Answers1

1

You can't do this. See this existing SO answer.

Instead, put your classes into appropriate packages and you will have no problem.

Community
  • 1
  • 1
Jason
  • 11,448
  • 3
  • 41
  • 46