Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Using FXMLLoaderFactory load FXML
Using FXMLLoaderFactory load FXML [message #1703569] Mon, 03 August 2015 08:36 Go to next message
Sake Bosanac is currently offline Sake BosanacFriend
Messages: 1
Registered: July 2015
Junior Member
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 17:55 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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: Thu Jan 23 07:24:59 GMT 2025

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

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

Back to the top