So I'm making a JForm program in Netbeans, it works fine when I run the individual .java files or when I run the project as a whole but as soon as I try and "pack" the program into a .jar file it just falls over. I'm 90% sure the code is fine. I've done a bit of research before posting and I think I may need to try and put the java libraries with the program? Anyway here's the error code I'm getting.
Edit
I've re-created the program and it's still not working on another project, this is the code:
package workproject;
import java.awt.Toolkit;
/**
*
* @author Robert
*/
public class WorkProject extends javax.swing.JFrame {
/**
* Creates new form WorkProject
*/
public WorkProject() {
initComponents();
setLocationRelativeTo(null);
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("assets\\icon.png")));
}
if I were to comment out the set icon line it would work fine, it also works fine when I run it in the net beans IDE but if, as stated earlier I create a .jar it won't run.