6

I created a .fxml file using javafx scene builder in NetBeans.

How can I convert .fxml file in NetBeans to .java? Is that any program to convert it?

I am not very good in fxml so I want to use .java file to code my javafx app.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Ken Wong
  • 109
  • 2
  • 2
  • 9

2 Answers2

6

There isn't any support for this kind of thing. The idea is that you are using FXML to visually layout your UI and then connecting it to java using a controller class.

Sidenote: We at e(fx)clipse started a build addon that allows you to converter FXML-Files into Java-Files - because of performance reasons on embedded devices.

UrsinusTheStrong
  • 1,239
  • 1
  • 16
  • 33
tomsontom
  • 5,856
  • 2
  • 23
  • 21
  • @tomsontom Could you elaborate on this addon? Is it a tool or library which could be wrapped by a Maven plugin? Or will it only work in Eclipse? – Puce Apr 23 '13 at 15:44
  • The idea is to have it as a library you can integrate into your build process (not matter which tool you use, we'll most likely out of the box support ant) - because we are currently moving our codebase to eclipse.org the work has been stalled a bit but I hope we can pickup speed in 1-2 weeks. – tomsontom Apr 23 '13 at 16:58
  • 1
    I've published a first pre alpha version. See http://www.mail-archive.com/openjfx-dev@openjdk.java.net/msg01589.html – tomsontom Aug 03 '13 at 11:26
5

Is that any program to convert it?

Yes. Netbeans FXML 2 JAVA Converter via Archive.org 2021.03.04 capture for http://plugins.netbeans.org/plugin/68619/fxml-2-java-converter.

marc-medley
  • 8,931
  • 5
  • 60
  • 66