开发者

Java error: Context already contains a binding with name ""

开发者 https://www.devze.com 2023-04-05 21:01 出处:网络
Ok so I have followed this tutorial step by step: Custom Java Desktop Database Application I can\'t understand what I\'m doing wrong but when I run the application and cli开发者_如何学编程ck on \"New

Ok so I have followed this tutorial step by step: Custom Java Desktop Database Application

I can't understand what I'm doing wrong but when I run the application and cli开发者_如何学编程ck on "New Customer" i get the following error:

Caused by: java.lang.IllegalArgumentException: Context already contains a binding with name ""

I believe that it has something to do with the combobox which is binded with the countries list which comes from the database. The binding expression is set to null and binding source is set to countriesList.

Any help would be appreciated guys?

Thanks


SOLVED

When binding elements of the combo box, in the advanced tab, I just set the name to "null"..and it started working.


while giving "null" into Identification's name works, it only works for the second occurance, you may not repeat the "null" string as the name for the third or any other occurances.

Because, actually the only one we need to remember is, the name needs to be unique. That's all :)


It seems something was changed in Netbeans. The bindings don't need a name, but for some reason Netbeans started adding "" as the name of many bindings. My solution has been to open the .java file in another editor and just removing the last , "" in the createAutoBinding method call.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号