No valid binding for root component

Answered

I am fiddling a bit with the GUI designer, and I must say that I'm really impressed. It is so easy and intuitive to work with.
I also watched the online demo, and I think it was well explained and thoroughly.

So I started out with a complex design right on, but when it came to invoke "Form main()" I got into troubles. To eliminate most variables possibly I started a new project and created a simple GUI (one label and one textfield). But I got the same error.

In both occasions I got this error:
The form bound to the class does not have a valid binding for the root component

I also checked the Component tree and it has no red line or yellow selections (I already made the mnemonics etc.)

Am I missing something?

0
21 comments
Avatar
Permanently deleted user

Hello Thomas,

TS> I am fiddling a bit with the GUI designer, and I must say that I'm
TS> really impressed. It is so easy and intuitive to work with.
TS>
TS> I also watched the online demo, and I think it was well explained
TS> and thoroughly.
TS>
TS> So I started out with a complex design right on, but when it came to
TS> invoke "Form main()" I got into troubles. To eliminate most
TS> variables possibly I started a new project and created a simple GUI
TS> (one label and one textfield). But I got the same error.
TS>
TS> In both occasions I got this error:
TS> The form bound to the class does not have a valid binding for the
TS> root component
TS> I also checked the Component tree and it has no red line or yellow
TS> selections (I already made the mnemonics etc.)
TS>
TS> Am I missing something?

In order to generate the main() method, the top-level panel of a form must
be bound to a field. This is not highlighted as an error because it is generally
a valid situation.

I'll try to make the error clearer, and in the next version the top-level
panel binding will be generated automatically by default.

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


2

Thanks a lot Dmitry. It rocks!

Thomas

0
Avatar
Permanently deleted user

Hi Dimitri,

first of all your Designer is very nice, well done!

Still I have a question please (I'm still a beginner): What do you mean concretely by "to bound the top-level panel to field"!?

Thanks

0
Avatar
Permanently deleted user

Hello Lotfi,

L> first of all your Designer is very nice, well done!
L>
L> Still I have a question please (I'm still a beginner): What do you
L> mean concretely by "to bound the top-level panel to field"!?

Select the panel, select the "field name" property in the inspector and enter
the name of the field. The corresponding field will be created in the Java
class.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


1
Avatar
Permanently deleted user

Oh Thanks for this quick answer..!

Actually I was trying to do what you suggested... but stupidly there was a space in my field name, so it was not working. Now it's fine...

Thanks again and have a nice day...

0
Avatar
Permanently deleted user

Since its required - seems like it should pick a default name for the JPanel automatically? It does for other components.

thx!

-Tim

0

I agree !00% - the UI Designer should absolutely either assign a default name for the root component, or prompt for one.

0
Avatar
Permanently deleted user

Good afternoon :
I'm doing a final project of a higher degree, and every time I start your program the same error happens, the xml of the FORM window does not run.
I have tried to give the route manually, but it does not work.
I use bitbucket and I have to copy and paste over the previous xml (which exists) so that everything goes back to normal. Please fix that mistake, it does waste a lot of time, especially in large projects.
I use your latest version, in case the information is useful.
Thank you very much.

0

Hello David,

Do you mean that the same form doesn't work after restarting IDE?

0
Avatar
Permanently deleted user
 
yes. Now I have found another way to make it work.
I go to the .form file and place a small error for example:> I save it and then I delete it and save it again, then everything goes back to normal
0

David,

Is it possible to provide sample project example for investigation?

 

0
Avatar
Permanently deleted user

Yes. my bitbucket is public . My name is k3ym4n and the projet is SGE

0

David,

Provided project works fine on my machine. Is there MenuBar.xml file in the output folder when you run project after  restarting?

 

0
Avatar
Permanently deleted user

Yes, but that menubar.xml is executed after entering the program.
I close it and when I open it again I have to find the .form and make the modification that I explained in the previous post
.

 

0

David,

I couldn't reproduce the issue on my machine. I built project, ran it (menu is shown fine), restarted ide, ran project (menu is shown). Am I missing some steps?

0
Avatar
Permanently deleted user

then it will be my IDE, maybe ... should I reinstall it?

0
Avatar
Permanently deleted user
I have reinstalled the IDE and the first execution has been perfect. 
I closed it and reopened it and the error persite. The first message says like this: this view is not availabe until indices are built.

I immediately after where the window should be says: Form file is invalid: Error loading nested form:
Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation


0
Avatar
Permanently deleted user

  Sometimes it happens only with one window but other happens with almost all.

I get a git status and it always changes the file .idea / workspace.xml 
I do not know if that will help you

 

0

David,

I finally could reproduce the issue. Seems it caused by reindexing process. Simply reopening form works fine on my machine.

We have related issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-170263

Please follow it for updates

 

0
Avatar
Permanently deleted user

OK thanks
Today the problem has gone to more and I took the class out of the form.

I had to copy everything in a similar class and halfway back to normal.
I will follow the thread
Thank you very much for your attention

0

David,

You are welcome!

0

Please sign in to leave a comment.