[英]Error to clone a project from Github with images to Netbeans
每次我嘗試將帶有圖像的項目從 GitHub 克隆到 Netbeans 時,當我嘗試運行時都會向我顯示如下錯誤:
https://hastebin.com/bexokemalo.bash
我做了什么?
這段代碼沒有錯誤,完整代碼在github上: https : //github.com/dotrz/img
具有 NPE (NullPointerExecption) 的行位於otrz/otrzJFrame.java#initComponents()
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imgs/test.png"))); // NOI18N
嘗試分解該行以檢查:
jLabel1
不為空getClass().getResource("/imgs/test.png")
不為空
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.