|
Re: Cannot change inherited controls [message #1062559 is a reply to message #1062484] |
Sun, 09 June 2013 00:55 |
Eric Clayberg Messages: 979 Registered: July 2009 Location: Boston, MA |
Senior Member |
|
|
Actually, the exception is being raised by the FormLayout itself (not by WindowBuilder) because the example code is violating a constraint. The example code throws the following exception:
java.lang.IndexOutOfBoundsException: The column index 7 must be less than or equal to 5.
at com.jgoodies.forms.layout.CellConstraints.ensureValidGridBounds(CellConstraints.java:935)
at com.jgoodies.forms.layout.FormLayout.setConstraints(FormLayout.java:826)
at com.jgoodies.forms.layout.FormLayout.addLayoutComponent(FormLayout.java:1103)
It appears you are trying to add a widget to the 7th column of a 5 column grid. That won't work. You can add inherited controls, but they can't violate the column spec defined in the parent. If I add an extra column to the parent class in your example, it then works fine whether I add the widget manually or through the editor.
[Updated on: Sun, 09 June 2013 00:55] Report message to a moderator
|
|
|
Re: Cannot change inherited controls [message #1062562 is a reply to message #1062559] |
Sun, 09 June 2013 01:18 |
Thiago DP Messages: 4 Registered: June 2013 |
Junior Member |
|
|
OK. Many thanks, Eric. It is strange because when I try to add a component (like a button), it can't be placed in the parent's cell. I thought I could add columns/rows and add new components in the child class, like I used to do in other GUI frameworks, like Borland ones. So it is a constraint, right? Swing behaves a little bit different than I thought...
[Updated on: Sun, 09 June 2013 01:25] Report message to a moderator
|
|
|
|
Re: Cannot change inherited controls [message #1062564 is a reply to message #1062563] |
Sun, 09 June 2013 01:54 |
Thiago DP Messages: 4 Registered: June 2013 |
Junior Member |
|
|
I also can't add new columns/rows in the child, right? (I need to define everything in the parent).
WindowBuilder shows a "java.lang.ClassCastException: org.eclipse.wb.internal.swing.model.layout.ImplicitLayoutCreationSupport cannot be cast to org.eclipse.wb.internal.core.model.creation.ConstructorCreationSupport"
message when I try to do this.
Maybe it would be better (if possible) show better messages depending on the context. Just to make it easier to understand.
Thank you.
[Updated on: Sun, 09 June 2013 02:04] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03084 seconds