I’m a beginner when it comes to Java and I’m following the instructions from a book. I am going to create a FigurePanel with the following code:
import java.awt.*;
import javax.swing.*;
public class TestFigurePanel extends JFrame{
public TestFigurePanel() {
setLayout(new GridLayout(2, 3, 5, 5));
add(new FigurePanel(FigurePanel.LINE));
}
}
But at the “add(new FigurePanel(FigurePanel.LINE));” I get the following error:
“Cannot find symbol:
Symbol: class FigurePanel
class: TestFigurePanel”
I would be very happy if someone good inform me of what is causing this problem.
Add this class in your package: