Java Null Error

Joined
Sep 26, 2009
Messages
2
Reaction score
0
Hello I'm currently stuck on an error Java is giving me.

--------------------Configuration: <Default>--------------------
Exception in thread "main" java.lang.NullPointerException
at java.awt.Container.addImpl(Container.java:1041)
at java.awt.Container.add(Container.java:959)
at javax.swing.JFrame.addImpl(JFrame.java:545)
at java.awt.Container.add(Container.java:927)
at ColorFactory.<init>(ColorFactory.java:21)
at ColorFactoryDemo.main(ColorFactoryDemo.java:5)

Process completed.

This is a simple code i have written. The purpose of my program is to change the colors of a text's (in the Center Region of the JPanel) foreground with the 3 different color JRadioButtons that are located on the south region of the panel and to chage the Center Panel's background with the JButtons that are located on the North region of the panel, but unfortunately i cannot even see the window because of the error i wrote above. I have included my code inside the ColorFactory.zip file and also have included the projects instructions on the PDF file, please help, i do not understand why i'm getting this error, i'm still a novice in programming, thank you
 

Attachments

  • ColorFactory.zip
    33.7 KB · Views: 130

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top