This has been driving me crazy and maybe someone here can help me out. I have created a layout using Netbeans 7.0.1 using swing - its a SingleFrameApplication. Now on my laptop i have Netbeans version 7.1.1, as of 7.1.1 the UI panel is not supported anymore however the code should still compile?. It does not, i get this error, does anyone know of any solution or why it does it?
Asked
Active
Viewed 358 times
0
-
4Caused by: java.lang.NullPointerException ... check this part of StackTrace.. post some code, so people can help you indentify the problem – Serhiy Mar 03 '12 at 10:45
-
2This is not a compilation error. It's a runtime exception. – JB Nizet Mar 03 '12 at 11:02
-
I am new to java and i dont quite understand how to use stacktrace?. I have pasted the generated code for the file here http://www.pastebin.ca/2123760 . What do i need to alter to make this work? i have been trying for hours to figure it out =/ – Rory Lester Mar 03 '12 at 11:18
-
What you posted above is a stack trace, but it's too long for all of it to be included. All we really care about is the last part that begins with java.lang.nullPointerException You can place your launch code into a try catch block like this: try { – Thorn Mar 03 '12 at 12:09
-
If I had to guess: For some reasen the line ResourceMap resourceMap = getResourceMap(); returns null, so if you access the resourceMap you get a NullPointerException. – keuleJ Mar 03 '12 at 12:27
-
Did you create a [jsr-296](http://java.sun.com/developer/technicalArticles/javase/swingappfr/) project [intentionally](http://stackoverflow.com/a/2561540/230513)? – trashgod Mar 03 '12 at 12:36
2 Answers
0
If I remember correctly, NetBeans 6.5 used some custom layouts which you explicitly had to add to your distribution, otherwise the app would fail to start. This sounds similar, but please do post the rest of the stack trace.

mbatchkarov
- 15,487
- 9
- 60
- 79
-
The thing you have posted above is called a stack trace and shows the order in which different parts of the application were executed. Your sample ends with "...14 more", which is where the answer might be hiding – mbatchkarov Mar 03 '12 at 11:49
0
What you posted above is a stack trace, but it's too long for all of it to be included. All we really care about is the last part that begins with java.lang.nullPointerException You can place your launch code into a try catch block like this:
try {
yourApp.launch();
{
catch(NullPointerException ug) {
ug.printStackTrace();
}

Thorn
- 4,015
- 4
- 23
- 42