1

I have created a Swing GUI using NetBeans, and I am able to execute it on my local machine successfully. But whenever I execute the JAR file gui_test.jar on another PC, it give me the error shown below.

The classes in the package gui_test are:

  • gui.gui
  • StreamGobbler.java

ERROR

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at gui_test.gui.walk(gui.java:967)
at gui_test.gui.<init>(gui.java:1030)
at gui_test.gui$17.run(gui.java:1030)
at java.awt.event.InvocationEvent.dispatch (Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

at jaya.awt.Eyentgueue.dispatchEyent(Unknown Source)
at jaya.awt.EyentDispatchIhread.punpOneEyentForFilters(Unknown Source)
at jaya.awt.EyentDispatchIhread.punpEyentsForFilter(Unknown Source)
at jaya.awt.EyentDispatchIhread.punpEyentsForHierarchy(Unknown Source)
at jaya.awt.EyentDispatchIhread.punpEyents(Unknown Source)
at jaya.awt.EyentDispatchIhread.punpEyents(Unknown Source)
at java.awt.EyentDispatchIhread.run(Unknown Source)

Any suggestions to resolve the problem will be appreciated.

Community
  • 1
  • 1
user1582498
  • 25
  • 2
  • 10
  • Are the other machines the same OS? Are they all 32bit, 64bit, or a mix? Have you tied a simpler version of your code on those other machines? – Pyrce Aug 07 '12 at 16:40
  • 1
    typos in standard exception stack message are strange –  Aug 07 '12 at 16:40
  • 1
    Since the error is occurring in `gui_test.gui.walk`, I'd suggest focusing on that bit of code. Post it here for review. – Richard Sitze Aug 07 '12 at 16:45
  • Sounds like you forgot to include a required resources. Be nice to see the relevant code – MadProgrammer Aug 07 '12 at 20:21

2 Answers2

1

Following are possible.

  1. You have developed it in a new version of Java, and the "other" machine is having an old version
  2. Issues in JRE of the other machine
  3. Problems with the build. Try a clean > rebuild in netbeans

That's all I can think about. Try this in another few machines, which has the same Java version, then only you can get the issue.

PeakGen
  • 18,056
  • 71
  • 208
  • 385
0

I'm not too familiar with Netbeans, But I do recall having problem importing a GUI from Netbeans into eclipse. This is possibly because the Netbeans GUI uses certain libraries.

Check this question, and this answer, it might help you https://stackoverflow.com/a/4498151/975959

Community
  • 1
  • 1
La bla bla
  • 8,260
  • 9
  • 57
  • 101