Cannot resolve symbol 'Gamepanel'

393 Views Asked by At

i had this problem with this code and it got the error "Cannot resolve symbol 'Gamepanel'"

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;


public class GameFrame extends JFrame{


    GameFrame(){
        GamePanel panel;
        panel = new Gamepanel();
        this.add(panel);
        this.setTitle("Pong Game");

    }
}

can someone help me, please?

1

There are 1 best solutions below

0
On

The problem is that you variable panel is from the type GamePanel. Therefore, when you assign panel an Instance, you have to write the classname correct:

GamePanel panel;
panel = new GamePanel(); // GamePanel not Gamepanel