http://puu.sh/hLNH1/74b40dff89.png

I have tried googling this issue for many hours been asking around on Skype I haven't found the solution yet. So I think it's time to ask professional developers what's going on.

我已经尝试谷歌搜索这个问题好几个小时一直在Skype上询问我还没有找到解决方案。所以我认为是时候向专业开发人员询问发生了什么。

Alright so I get the following error:

好吧,我得到以下错误:

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: javax.swing.JFrame.setContentPaneel at Vb0301.main(Vb0301.java:11)

线程“main”中的异常java.lang.RuntimeException:无法编译的源代码 - 错误的sym类型:Vb0301.main的javax.swing.JFrame.setContentPaneel(Vb0301.java:11)

I've just started to learn Java for my study and the cody provided in the Puush link is a direct copy from the book.

我刚刚开始为我的学习学习Java,而Puush链接中提供的cody是本书的直接副本。

I know it has something to do with:

我知道它与以下内容有关:

frame.setContentPaneel(new Paneel() );

So I tried switching it from that to:

所以我尝试将它从那里切换到:

frame.setContentPane(new Paneel() );

But at this point I get new errors link: http://puu.sh/hLNVU/c760502ca9.png

但此时我收到了新的错误链接:http://puu.sh/hLNVU/c760502ca9.png

It's starting to annoy the heck out of me to setup IDE in the first place the last couple of days have been errors after errors...

在错误发生后的最后几天出现错误的情况下,我开始惹恼我设置IDE。

I hope someone is able to help I've been looking around here but didn't find the specific question. I hope to get replies soon, thanks in advance.

我希望有人能够帮助我一直在这里寻找,但没有找到具体的问题。我希望很快得到答复,先谢谢。

Naomi,

3 个解决方案

#1


You are using the wrong class name. Paneel does not exist, it should be Panel instead.

您使用的是错误的类名。 Paneel不存在,应该是Panel而不是。

Also, the method you are calling is called setContentPane(). See the reference for more information.

此外,您调用的方法称为setContentPane()。有关更多信息,请参阅参考。

Edit: As you can see in the comments on this answer, the problem was in the Panel class (but not as stated above). Panel has to extend JPanel to allow it to be added to the frame.

编辑:正如您在此答案的评论中所看到的,问题出在Panel类中(但不是如上所述)。 Panel必须扩展JPanel才能将其添加到框架中。

更多相关文章

  1. Java:IntelliJ想法生成的代码错误地为所有Class名称添加了其包名
  2. “不是抽象的,也不重写抽象的方法”错误
  3. java中多线程安全问题产生&解决方案——同步方法

随机推荐

  1. Android(安卓)Rootkit开发技术要点 (一)
  2. Android(安卓)Messenger 进程间通信
  3. Android(安卓)make脚本简记
  4. 一些学习技术的视频
  5. Android汉字按拼音首字母查询
  6. Android(安卓)如何创建组合控件
  7. Android网络编程 HttpUrlConnection Http
  8. Android面试之---谈谈你对Android(安卓)N
  9. 【android】喜马拉雅FM sdk使用
  10. Android(安卓)Lint使用分析