Using Netbeans, I wrote a simple GUI test app, but it doesn't find the other class defined in the project.
DrawPanel:
import java.awt.Graphics;
import javax.swing.JPanel;
public class DrawPanel extends JPanel
{
    public void paintComponent( Graphics g)
    {
        super.paintComponent(g);
        int w = getWidth();
        int h = getHeight();
        g.drawLine(0, 0, w, h);
        g.drawLine(0, h, w, 0);
    }
}
Guitest2.java
package guitest2;
import javax.swing.JFrame;
public class Guitest2 {
    public static void main(String[] args) {
        DrawPanel panel = new DrawPanel();
        JFrame app = new JFrame();
        app.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE);
        app.add(panel);
        app.setSize(250, 250);
        app.setVisible(true);
    }   
}
The error is
error: cannot find symbol
    DrawPanel panel = new DrawPanel();
Please see the picture

