Hi,
I'm having trouble figuring out why the compiler throws a NullPointerException when I try to add a JRadioButton to my JPanel and JButtonGroup.
All will become clear after this:
The error happends on line 42 (marked with comment).
Stacktrace:
Exception in
thread "main" java.lang.NullPointerException
at Opgave_1.<init>(Opgave_1.java:42)
at Opgave_1.main(Opgave_1.java:25)
If I try to add the JRadioButton rbFa to the panel before I add it to the group, the same error appears.
I'm probably making a simple mistake, but I can't figure out what.
Thanks