470,596 Members | 1,528 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

NullPointerException when adding event to Jbutton - Netbeans

I am trying to edit the GUI of a project in Netbeans. In particular, I am trying to add new JButtons. I get a NullPointerException when I try to add an Event to any given JButton (even ones that already exist) in my application using the Design Editor.

I go about this by right-clicking on the JButton in the design editor, navigating to Events -> Action -> actionPerformed. The auto-generated code appears for a brief moment before it disappears and throws the NullPointerException. I am using NetBeans IDE 6.1 and JDK 6u7.

Below is the details of the exception. I am in dire need of a solution, but cannot find any solutions on the web, only old Bug tickets related to similar issues that have allegedly been fixed long ago. If anyone has some ideas, please assist me!

Expand|Select|Wrap|Line Numbers
  1. java.lang.NullPointerException
  2. at org.netbeans.modules.form.JavaCodeGenerator.getPro pertyCreator(JavaCodeGenerator.java:2263)
  3. at org.netbeans.modules.form.JavaCodeGenerator.genera tePropertyBeanSetterCode(JavaCodeGenerator.java:22 11)
  4. at org.netbeans.modules.form.JavaCodeGenerator.genera tePropertySetter(JavaCodeGenerator.java:2155)
  5. at org.netbeans.modules.form.JavaCodeGenerator.genera teProperty(JavaCodeGenerator.java:2081)
  6. at org.netbeans.modules.form.JavaCodeGenerator.genera teComponentProperties(JavaCodeGenerator.java:1603) 
  7. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1171)
  8. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  9. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  10. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  11. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  12. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  13. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  14. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  15. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  16. at org.netbeans.modules.form.JavaCodeGenerator.addIni tCode(JavaCodeGenerator.java:1184)
  17. at org.netbeans.modules.form.JavaCodeGenerator.regene rateInitComponents(JavaCodeGenerator.java:1027)
  18. at org.netbeans.modules.form.JavaCodeGenerator.regene rateCode(JavaCodeGenerator.java:3418)
  19. at org.netbeans.modules.form.JavaCodeGenerator$FormLi stener.formChanged(JavaCodeGenerator.java:3887)
  20. at org.netbeans.modules.form.FormModel.fireEvents(For mModel.java:1268)
  21. at org.netbeans.modules.form.FormModel.fireEventBatch (FormModel.java:1241)
  22. at org.netbeans.modules.form.FormModel.firePendingEve nts(FormModel.java:1204)
  23. at org.netbeans.modules.form.FormModel.access$000(For mModel.java:62)
  24. [catch] at org.netbeans.modules.form.FormModel$2.run(FormMode l.java:1184)
  25. at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:209)
  26. at java.awt.EventQueue.dispatchEvent(EventQueue.java: 597)
  27. at org.netbeans.core.TimableEventQueue.dispatchEvent( TimableEventQueue.java:104)
  28. at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:273)
  29. at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:183)
  30. at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:173)
  31. at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:168)
  32. at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:160)
  33. at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:121)
  34.  
Oct 6 '08 #1
1 2993
Stang02GT
1,208 Expert 1GB
This is a double post. Memeber has been notified about site policy, the other thread will be closed.




Moving to MISC.
Oct 6 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by porky008 | last post: by
oll3i
17 posts views Thread by oll3i | last post: by
nexcompac
8 posts views Thread by nexcompac | last post: by
1 post views Thread by ketand1 | last post: by
2 posts views Thread by KiranJyothi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.