Mohamed Sanaulla wrote:Can you show us the code you have? Without which it would be very hard to help you out.
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
John Damien Smith wrote:> all I really need to see, is some code that demonstrates how to instantiate a FXML form in one class, then use another class to update one of the controls from the instantiating class.
Review this StackOverflow question and see if it helps:
John Damien Smith wrote:>Yes, you can use a singleton pattern, though some consider it an anti-pattern.
You can use a dependency injection framework (such as afterburner.fx) to achieve something like a global view into system components (or rather the parts of the global view required by components is injected into them by the framework).
There are other mechanisms for loosely coupling components, for example
- the observer pattern that the JavaFX property system is based on
- an event bus.
John Damien Smith wrote:I still think that the dependency injection based approach I mentioned earlier such as Afterburner is cleaner than the either the object passing or static data approach, but I understand that concepts like dependency injection can sometimes seem strange to people.
John Damien Smith wrote:The following is going to get a bit dense and may be difficult to understand.