将图像从Github克隆到Netbeans的错误

问题描述 投票:-1回答:1

每次我尝试使用从GitHub到Netbeans的图像克隆项目时,当我尝试运行时显示这样的错误:

https://hastebin.com/bexokemalo.bash

我做了什么?

Netbeans clone

Netbeans open

NetBeans project

这段代码没有错误,github上的完整代码:https://github.com/dotrz/img

java github netbeans
1个回答
0
投票

具有NPE(NullPointerExecption)的行在otrz/otrzJFrame.java#initComponents()

jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imgs/test.png"))); // NOI18N

尝试并分解该行以检查:

  • jLabel1不是空的
  • getClass().getResource("/imgs/test.png")不是空的
© www.soinside.com 2019 - 2024. All rights reserved.