473,408 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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.  
Oct 2 '08 #1
2 2253
pronerd
392 Expert 256MB
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.
Oct 3 '08 #2
Stang02GT
1,208 Expert 1GB
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.
Oct 6 '08 #3

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

Similar topics

0
by: porky008 | last post by:
I need to add a search button to this and have no clue how to do it. Can some one please help me on this? import java.awt.*; import java.awt.event.*; import javax.swing.*; import...
17
oll3i
by: oll3i | last post by:
nevermind the previous prob i posted i m getting further and i get a new exception in readFile method pleae help me with that one thank u a lot in advance java.lang.NullPointerException...
8
nexcompac
by: nexcompac | last post by:
Ok, I am working on an inventory program and this is where I am at thus far. I seem to be getting two errors that I can not figure out. I will post the errors at the end of the code. import...
1
by: ketand1 | last post by:
import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.sql.*; import java.lang.*; class DbAwt extends Frame implements ActionListener { private...
1
by: Lost Prophet | last post by:
Hi Im having a problem with some code. Originally, the application was set into three packages (script, gui and control). I have changed is so there is a fourth called 'report'. Whenever I call...
2
by: KiranJyothi | last post by:
Hi All, I am trying to add buttons and I am not able to see them while running. Please let me know where I am going wrong. Thanks in advance. KiranJyothi <CODE> //KiranJyothi
1
by: sokeefe | last post by:
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...
2
by: dragonridingsorceress | last post by:
I am trying to learn how to use the JFileChooser. I'm working in BlueJ. I keep getting a NullPointerException. Full text of the error message is at the bottom of the post. My code is based on some...
1
by: onlinegear | last post by:
HI i am writing this for college i know i have loads of combo boxes with nothing in the i havent got that far yet. but every time i run this is comes up with this erro run: Exception in thread...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.