title: Java cannot find symbol error
body: <p>I know that "cannot find symbol" shows up when there misspelled something or the variable is not in the scope it is used or something like this. But still I cannot figure out what causes that problem in my situation. I have two classes: Driver.java and DisplayPanel.java</p>
  
  <p>Driver.java code : </p>
  
  <pre><code>package csHW9;
  
  import javax.swing.JFrame;
  import csHW9.DisplayPanel;
  
  public class Driver {
  
      public static void main(String[] args){
          JFrame frame = new JFrame("Dungeon Diver");
          DisplayPanel panel = new DisplayPanel();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.add(panel);
          frame.pack();
          frame.setVisible(true);
      }
  
  }
  </code></pre>
  
  <p>DisplayPanel.java code:</p>
  
  <pre><code>package csHW9;
  
  import java.awt.Dimension;
  import java.awt.Graphics;
  import java.awt.Point;
  
  import java.awt.event.KeyEvent;
  import java.awt.event.KeyListener;
  import javax.swing.*;
  
  import javax.swing.JPanel;
  public class DisplayPanel extends JPanel{   
  private Dungeon dungeon;
  
  public DisplayPanel(){
      setPreferredSize(new Dimension(600, 600));
      this.dungeon = new Dungeon();
      addKeyListener(new KListener());
      setFocusable(true); 
  }
  </code></pre>
  
  <p>Dungeon is just another class and I'm making its instance in DisplayPanel class.</p>
  
  <p>The error I get is this: </p>
  
  <pre><code> Driver.java:12: cannot find symbol
  symbol  : class DisplayPanel
  location: class csHW9.Driver
          DisplayPanel panel = new DisplayPanel();
  </code></pre>
  
  <p>I don't understand what I'm doing wrong. Any suggestions?</p>