Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » Using FXMLLoaderFactory load FXML
Using FXMLLoaderFactory load FXML [message #1703569] Mon, 03 August 2015 04:36 Go to next message
Eclipse UserFriend
Hi, I'm new with e(fx)clipse and JavaFX aslo, so I have a question or two.
I saw this at some examples on the net.
Is it wrong to pass (injected)FXMLLoaderFactory from handler to dialog constructor just to load it's fxml, e.g.
public MyDialog(Window parent, String title, FXMLLoaderFactory fxmlfactory) {
		super(parent, title);
		this.title = title;
		factory = fxmlfactory;
	}
....
factory.loadBundleRelative("myview.fxml"); ...


Isn't it easier to use the old fashioned way:
FXMLLoader.load(getClass().getResource("myview.fxml"));


Am I missing the point here? Rolling Eyes
Re: Using FXMLLoaderFactory load FXML [message #1703629 is a reply to message #1703569] Mon, 03 August 2015 13:55 Go to previous message
Eclipse UserFriend
a) passing it from the handler is wrong - the FXMLLoaderFactory has to be injected all time (unless the handler and dialog are in the same osgi bundle
b) using FXMLLoader directly in your sample will load the fxml file but it will fail to create an instance of your controller because it will use the extension classloader
Previous Topic:Glue in menu bar items
Next Topic:e(fx)clipse not found in Mars Update Site
Goto Forum:
  


Current Time: Sun Aug 31 04:13:10 EDT 2025

Powered by FUDForum. Page generated in 0.02492 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top