Jump to content


Check out our Community Blogs

Jhon

Member Since 16 Nov 2014
Offline Last Active Nov 25 2014 08:55 AM
-----

Posts I've Made

In Topic: Game - A simple Pong

18 November 2014 - 05:37 PM

 

I created the Pong class and copied the first part of the code, then I created the Complements class and copied the another part of the code, but the part keypressed and keyreleased are giving error.
 
    private void formKeyPressed(KeyEvent evt)
    {
        panel.keyPressed(evt);
    }
    private void formKeyReleased(KeyEvent evt)
    {
        panel.keyReleased(evt);
    }
The error is:
 
"cannot find symbol
symbol: method keyPressed(KeyEvent)
location: variable panel of the type JPanel"
 
What do I do?
*PS: the variable panel is your PanelPelota

 

 

NERVERMIND, I already solved!


In Topic: Game - A simple Pong

16 November 2014 - 04:16 PM

I created the Pong class and copied the first part of the code, then I created the Complements class and copied the another part of the code, but the part keypressed and keyreleased are giving error.
 
    private void formKeyPressed(KeyEvent evt)
    {
        panel.keyPressed(evt);
    }
    private void formKeyReleased(KeyEvent evt)
    {
        panel.keyReleased(evt);
    }
The error is:
 
"cannot find symbol
symbol: method keyPressed(KeyEvent)
location: variable panel of the type JPanel"
 
What do I do?
*PS: the variable panel is your PanelPelota

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download