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
  • 274,122
  • 60
  • 696
  • 724
intboolstring
  • 6,891
  • 5
  • 30
  • 44

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,744
  • 3
  • 42
  • 46