I have been trying to convert an AWT app to Swing. I started trying to convert the entire app in one shot and had this same problem. Now I have been slowly adding Swing to the App currently only in the form of JPanels. I can get jpanels to work fine, but when I try to change a Button to a Jbutton
Exception in thread "main" java.lang.NullPointerException
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
The line of code that it references is just an
If I don't add the Jbutton everything works fine.
And if its a AWT button it works fine.
I figure this is something simple that I'm missing, Anyone know what up from this vague description.?