What's Wrong WIth My Code involving JFrames

拟墨画扇 提交于 2019-12-02 09:37:45

Your GamePanel class does not extend any Swing GUI component such as Container or one of its children. Probably it should extend JPanel.

i.e.,

import javax.swing.JPanel;

public class GamePanel extends JPanel {
   // .... etc
}

Please don't add the urgent or "help as soon as possible" bit. Yes your question is very important, but it is no more important than anyone else's.

Edit: Mad's link is worth putting in the answer: The Oracle Swing Tutorial.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!