RectangleViewer: symbol not found

Viewed 52

I am a newbie to programming, specially with Java. Got a book for self study and now I am little stuck. I know the issue but not sure how to resolve it. Code below -

    import javax.swing.JFrame;

public class RectangleViewer 
{
    public static void main(String args[]) 
    {
        JFrame frame = new JFrame();
        
        frame.setSize(300,400);
        frame.setTitle("Two Rectengle");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        RectangleComponent component = new RectangleComponent(); /** <--- Error here
        frame.add(component);
        
        frame.setVisible(true);
    }
}

I am using Netbeans IDE 12. Error code pasted below...

C:\Users\marks\RectangleViewer.java:27: error: cannot find symbol
        RectangleComponent component = new RectangleComponent();
        ^
  symbol:   class RectangleComponent
  location: class RectangleViewer
C:\Users\marks\RectangleViewer.java:27: error: cannot find symbol
        RectangleComponent component = new RectangleComponent();
                                           ^
  symbol:   class RectangleComponent
  location: class RectangleViewer
2 errors
error: compilation failed

Thank you for your time and assistance.

0 Answers
Related