Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old October 2nd, 2008, 08:23 PM
Newbie
 
Join Date: Aug 2008
Posts: 3
Default NullPointerException when adding Event to JButton

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.getPropertyCreator(JavaCodeGenerator.java:2263)
  3.     at org.netbeans.modules.form.JavaCodeGenerator.generatePropertyBeanSetterCode(JavaCodeGenerator.java:2211)
  4.     at org.netbeans.modules.form.JavaCodeGenerator.generatePropertySetter(JavaCodeGenerator.java:2155)
  5.     at org.netbeans.modules.form.JavaCodeGenerator.generateProperty(JavaCodeGenerator.java:2081)
  6.     at org.netbeans.modules.form.JavaCodeGenerator.generateComponentProperties(JavaCodeGenerator.java:1603)
  7.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1171)
  8.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  9.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  10.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  11.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  12.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  13.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  14.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  15.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  16.     at org.netbeans.modules.form.JavaCodeGenerator.addInitCode(JavaCodeGenerator.java:1184)
  17.     at org.netbeans.modules.form.JavaCodeGenerator.regenerateInitComponents(JavaCodeGenerator.java:1027)
  18.     at org.netbeans.modules.form.JavaCodeGenerator.regenerateCode(JavaCodeGenerator.java:3418)
  19.     at org.netbeans.modules.form.JavaCodeGenerator$FormListener.formChanged(JavaCodeGenerator.java:3887)
  20.     at org.netbeans.modules.form.FormModel.fireEvents(FormModel.java:1268)
  21.     at org.netbeans.modules.form.FormModel.fireEventBatch(FormModel.java:1241)
  22.     at org.netbeans.modules.form.FormModel.firePendingEvents(FormModel.java:1204)
  23.     at org.netbeans.modules.form.FormModel.access$000(FormModel.java:62)
  24. [catch] at org.netbeans.modules.form.FormModel$2.run(FormModel.java:1184)
  25.     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.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.pumpOneEventForFilters(EventDispatchThread.java:273)
  29.     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
  30.     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
  31.     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
  32.     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
  33.     at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
  34.  

Last edited by Nepomuk; October 7th, 2008 at 02:59 PM. Reason: The CODE tags end with [/CODE], not with [CODE]
Reply
  #2  
Old October 3rd, 2008, 06:05 PM
Expert
 
Join Date: Nov 2006
Posts: 375
Default

This form is for Java programing questions. If you need help with Netbeans you need to post your question is form that covers Netbeans questions.
Reply
  #3  
Old October 6th, 2008, 05:53 PM
Stang02GT's Avatar
Moderator
 
Join Date: Jun 2007
Location: USA
Age: 23
Posts: 1,132
Default

This is a double post. The user has posted the same question in the Software Dev forum.



If you would like delete this thread, and i will move the other thread to the MISC form and talk to the poster.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.