473,725 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NullPointerExce ption when adding event to Jbutton - Netbeans

3 New Member
I am trying to edit the GUI of a project in Netbeans. In particular, I am trying to add new JButtons. I get a NullPointerExce ption 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 NullPointerExce ption. 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 3191
Stang02GT
1,208 Recognized Expert Top Contributor
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

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

Similar topics

2
3083
by: Smith | last post by:
The program compiled successfully, but it gives the following error on runtime.... java.lang.NullPointerException at FrogManiaApp.paint(FrogManiaApp.java:102) at sun.awt.RepaintArea.paint(RepaintArea.java:177) at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260) at java.awt.Component.dispatchEventImpl(Component.java:3678) at java.awt.Container.dispatchEventImpl(Container.java:1627)
0
2387
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 javax.swing.event.*; import javax.swing.JFrame.*; class Testing {
17
1784
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 at konta_bankowe.Interfejs.readFile(Interfejs.java) at konta_bankowe.Interfejs.wyswietlHistorieRachunku(Interfejs.java) at konta_bankowe.Interfejs.access$0(Interfejs.java)
8
2051
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 java.util.*; import java.awt.*; import javax.swing.*; import java.awt.event.*;
1
2494
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 TextField t1, t2, t3;
2
1686
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
2
2277
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 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...
2
6888
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 of the examples I've seen online - in fact, it is almost identical. The only things I've changed (I think) are variable names. The main one I've been using for reference is from Sun's Java Tutorials. Admittedly, I don't fully understand the whole...
1
6756
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 "main" java.lang.NullPointerException at java.awt.Container.addImpl(Container.java:1041) at java.awt.Container.add(Container.java:365) at orderingsystem.OrderingSystem.<init>(OrderingSystem.java:261) at...
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9174
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8096
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2634
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.