Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fxml file not updating in Eclipse

I'm experiencing a weird behaving in Eclipse when working with JavaFx, when I modify a FXML document in SceneBuilder, I save the changes, but when I run the project, my changes don't appear, it s after I refresh the concerned Fxml document that the changes work when I run the application, I'm obliged to do this every time I change something using SceneBuilder, any explanation or solution for this problem ?

like image 535
AymenDaoudi Avatar asked May 19 '13 14:05

AymenDaoudi


People also ask

How do I run an FXML file in eclipse?

You can edit an FXML file using the Eclipse FXML editor or by opening the file using the JavaFX Scene Builder tool: In the IDE's Package Explorer tab, expand the Test1 and src folders. Right-click the node for the Sample. fxml file and select Open with Scene Builder, as shown in Figure 3-6.

Is FXML a form of XML?

FXML is an XML-based user interface markup language created by Oracle Corporation for defining the user interface of a JavaFX application. FXML presents an alternative to designing user interfaces using procedural code, and allows for abstracting program design from program logic.


2 Answers

The problem is that Eclipse does NOT by default track external changes to files and when you execute an application you are not executing the stuff in the "src" folder but the one that gets copied by eclipse to your "bin" one.

You can turn on active polling of sources on in the Eclipse Preferences page "General > Workspace" by checking "Refresh using native hooks or polling".

like image 112
tomsontom Avatar answered Oct 04 '22 11:10

tomsontom


If you create a project with option:

"Use project folder as root for sources and class files"

selected, you don't have that problem.

like image 40
marija Avatar answered Oct 04 '22 12:10

marija