Eu to tentando fazer um formulario JFrame, dai qdo eu coloco um icone no label ele da o seguinte erro ao executar, sera que alguem pode ajudar??O codigo esta mais abaixo:
Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:138 )
at main.view.CadastroFuncionario.initComponents(CadastroFuncionario.java:34 )
at main.view.CadastroFuncionario.<init>(CadastroFuncionario.java:17 )
at main.view.CadastroFuncionario$1.run(CadastroFuncionario.java:63 )
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209 )
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597 )
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273 )
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183 )
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173 )
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168 )
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160 )
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121 )
package main.view;
public class CadastroFuncionario extends javax.swing.JFrame {
/** Creates new form CadastroFuncionario */
public CadastroFuncionario() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/utilitarios/icons/paper&pencil_48.png"))); // NOI18N
jLabel1.setText("Cadastrar Funcionario");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(24, 24, 24)
.addComponent(jLabel1)
.addContainerGap(356, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jLabel1)
.addContainerGap(420, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new CadastroFuncionario().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
// End of variables declaration
}