Evening everyone.
I seem to have hit an odd problem when trying to pass an object to another objects constructor who's constructor also relies on the object it's being passed to.
For instance, take the example below:
ToolBar myToolBar = new ToolBar(webPanel);
WebPanel webPanel = new WebPanel(myToolBar);
However when constructing ToolBar it returns a NullPointerException. Ofcourse that's because webPanel isn't constructed yet and it requires it.
Both of the decelerations and initialization must remain in the same class (called BuildUI) since it's where I set up the properties. (It also doesn't make sense for a ToolBar to create a webPanel object and vice versa).
I'm also not sure if that's even good programming practice, since both objects require references to each other.
Any advice here is much appreciated. Thanks, Tom.