Problems with GUI Designer tutorial

I tryed to make a GUI in IDEA for the first time.
http://www.jetbrains.com/idea/training/ui_designer.html

I'm getting frustrating because even their example Subsriber.java does't work.
I may look stupid, but i've got nullpoiter exception
java.lang.NullPointerException
at Subscriber.]]>(Subscriber.java:26)
at Subscriber.main(Subscriber.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Exception in thread "main"

It seems that form is uninicialized, but it should work as it is example.

What I'm doing wrong?

Thanks,
osim

7 comments

osim wrote:

What I'm doing wrong?


Add the formsrt.jar to your project libraries. You need that for the
runtime support.

0

Hi Mark,

I thought that it will be such problem.
But it does'n help me.
See my VM settings, there is forms_rt.jar and formsrt.jar in class path.

C:\j2sdk1.4.2_06\bin\java -Didea.launcher.port=7536 -Didea.launcher.library=D:\work\ideaIDE\bin\breakgen.dll -Dfile.encoding=windows-1250 -classpath C:\j2sdk1.4.2_06\jre\lib\charsets.jar;C:\j2sdk1.4.2_06\jre\lib\jce.jar;C:\j2sdk1.4.2_06\jre\lib\jsse.jar;C:\j2sdk1.4.2_06\jre\lib\plugin.jar;C:\j2sdk1.4.2_06\jre\lib\rt.jar;C:\j2sdk1.4.2_06\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_06\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.2_06\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.2_06\jre\lib\ext\localedata.jar;C:\j2sdk1.4.2_06\jre\lib\ext\sunjce_provider.jar;C:\j2sdk1.4.2_06\jre\javaws;C:\j2sdk1.4.2_06\jre\javaws\javaws.jar;D:\work\ideaIDE\lib\forms_rt.jar;D:\work\ideaIDE\lib\formsrt.jar;D:\work\ideaIDE\lib\idea_rt.jar com.intellij.rt.execution.application.AppMain Subscriber

Hmm.. it is strange.

Osim

0

Hello osim,

You got NPE becouse IDEA not generate form for Subscriber. It may occurs,
then you forgot to link your form with class.
Check all mapped fields in GUI forms and also check that form itself is mapped
on your GUI bean class (aka Subscriber).

Good luck!
--
Alexey Efimov, Java Developer
Tops BI
http://www.topsbi.ru

0

Hello osim,

o> See my VM settings, there is forms_rt.jar and formsrt.jar in class
o> path.

You need only forms_rt.jar in classpath to run GUI forms.

Thanks!
--
Alexey Efimov, Java Developer
Tops BI
http://www.topsbi.ru

0

Hi Alexey,

Offcourse everythig id bind correctly, I check it hundred times :)))
And I also tryed possibility to incluse/exclude forms_rt and formsrt ...

But I tryed to create completly new project and copy subscriber example another time and it works?!? It is mistery for me...
I tryed to make a new form in this project and I'v got NPE again.

It is like a bad joke ...

Thanks for interest :)

osim

0

This may be caused if the form doesn't get compiled at all. Make sure that you
invoke "Make Project" before you run the application, or that you have checked
the flag "Make module before running ..." in the Run Configuration. Compiling
just the Subsbriber class is not enough.

If this still doesn't help, try to switch to source code generation (see Project
Settings -> GUI Designer) and see if IDEA generates the code into the Subscriber
class' source code. If it does, the NPE should go away and it's a problem with the
patching of the compiled class file.

If all else fails, try to recreate your project. If it still doesn't work, post it
here so people can look into it.

HTH,
Sascha

osim wrote:

I tryed to make a GUI in IDEA for the first time.
http://www.jetbrains.com/idea/training/ui_designer.html

I'm getting frustrating because even their example Subsriber.java does't work.
I may look stupid, but i've got nullpoiter exception
java.lang.NullPointerException
at Subscriber.<init>(Subscriber.java:26)
at Subscriber.main(Subscriber.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Exception in thread "main"

It seems that form is uninicialized, but it should work as it is example.

What I'm doing wrong?

Thanks,
osim

0

Hello osim,

o> Offcourse everythig id bind correctly, I check it hundred times :)))
o> And I also tryed possibility to incluse/exclude forms_rt and formsrt

Not only ids must be binded. Your root (named 'Form') also must be binded
on your class.
Is it?

If you bind class to form, then all fields in class what bindd, will have
gutter icon like 'form' icon.

Thanks!
--
Alexey Efimov, Java Developer
Tops BI
http://www.topsbi.ru

0

Please sign in to leave a comment.