Java GUI静态组件,NullPointerException [英] Java GUI Static component, NullPointerException

查看:75
本文介绍了Java GUI静态组件,NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我创建了一个GUI项目,我正在使用JTree。当它被创建时一切正常,但是当我调用它时,在我的run()方法中,我得到一个nullPointerException。这是代码。

Hey everyone, I created a GUI project, where I''m using a JTree. When it''s created everything is ok, but in my run() method when I call it i get a nullPointerException. Here is the code.

展开 | 选择 | Wrap | 行号

推荐答案

当你得到异常时它会告诉你它在代码中的哪一行?
when you get the exception does it tell you which line in the code it is on?


好吧它说:


线程中的异常AWT-EventQueue-0 java.lang.NullPointerException

在charybdis.Main
well yeah it says:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at charybdis.Main


2.run(Main.java:260)

就是这个line
2.run(Main.java:260)
and it is this line
展开 | 选择 | Wrap | 行号


这篇关于Java GUI静态组件,NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆