|
|
|
|
Re: MIgrating from Netbeans 3.6 to Eclipse 3.0.1 [message #70317 is a reply to message #63378] |
Mon, 08 November 2004 16:44 |
Joe Winchester Messages: 496 Registered: July 2009 |
Senior Member |
|
|
Hi calvin,
> I just tried it with the "Anagrams" example that comes with the Netbeans
> 4.0 beta 1 and it did work too well. But it shows up correctly when you
> "Run as Java Bean" and of course if you run as an app.
I think the problem is how the NetBeans code is using its
GridBagConstraints. They re-use the same field, e.g.
GridBagConstraints constraints = new GridBagConstraints();
panel.add(component1,constraints);
constraints.gridx = 2;
panel.add(component2,constraints);
The VE parses code and currently does not deal with shared properties in
this way. It's a subtle thing that GridBagLayout does where in fact the
constraints are not shared (they are cloned by the layout manager),
because with any other piece of Java code objects are passed by
reference and changing the constraint and re-using it wouldn't be allowed.
We do have a bugzilla to deal with this kind of grid bag constraints
behavior as it is quite a common coding pattern, however in the meantime
try changing the source so that each GridBagConstraints is a new field, e.g.
GridBadConstraints constraints = new GridBagConstraints();
panel.add(component,constraints);
GridBagConstraints contstraints1 = new GridBagConstraints();
panel.add(component2,constraints1);
The key is that the single field for GridBagConstraints it not shared.
Once this change is done the VE should be able to open the source OK.
Best regards,
Joe Winchester
|
|
|
|
|
|
Re: MIgrating from Netbeans 3.6 to Eclipse 3.0.1 [message #602709 is a reply to message #63378] |
Mon, 08 November 2004 16:44 |
Joe Winchester Messages: 496 Registered: July 2009 |
Senior Member |
|
|
Hi calvin,
> I just tried it with the "Anagrams" example that comes with the Netbeans
> 4.0 beta 1 and it did work too well. But it shows up correctly when you
> "Run as Java Bean" and of course if you run as an app.
I think the problem is how the NetBeans code is using its
GridBagConstraints. They re-use the same field, e.g.
GridBagConstraints constraints = new GridBagConstraints();
panel.add(component1,constraints);
constraints.gridx = 2;
panel.add(component2,constraints);
The VE parses code and currently does not deal with shared properties in
this way. It's a subtle thing that GridBagLayout does where in fact the
constraints are not shared (they are cloned by the layout manager),
because with any other piece of Java code objects are passed by
reference and changing the constraint and re-using it wouldn't be allowed.
We do have a bugzilla to deal with this kind of grid bag constraints
behavior as it is quite a common coding pattern, however in the meantime
try changing the source so that each GridBagConstraints is a new field, e.g.
GridBadConstraints constraints = new GridBagConstraints();
panel.add(component,constraints);
GridBagConstraints contstraints1 = new GridBagConstraints();
panel.add(component2,constraints1);
The key is that the single field for GridBagConstraints it not shared.
Once this change is done the VE should be able to open the source OK.
Best regards,
Joe Winchester
|
|
|
Powered by
FUDForum. Page generated in 0.04360 seconds