12

Sorry for such a simple question but I'm finding it hard to believe that I can't actually view the fxml whilst developing a user interface using JavaFX Scenebuilder.

I'd expect that I should be able to write a user interface using the controls as well as being able to directly write the fxml.

How do I view/edit the fxml of my user interface in SceneBuilder without doing the following: -

  1. Saving
  2. Editing with text editor
  3. Re-open with JavaFX Scene Builder

i.e. http://www.webhostingplanguide.com/wp-content/uploads/2013/12/CoffeeCup-HTML-Editor.jpg

As above, I would like to be able to work on either the FXML or the WYSIWYG front end.

ed_me
  • 3,338
  • 2
  • 24
  • 34
  • I've never had problems with opening a valid fxml in scene builder. Can't you just open it with ? I don't undestand your question. – Lars Sep 05 '14 at 17:14
  • If I create a new project and drag a button to the view, I'd like to be able to see the FXML that is created. Surely there is a split view, as in, if you're designing a web page with a WYSWYG application, you can usually see both the source code and the front end. – ed_me Sep 05 '14 at 17:16
  • Sorry I don't know a way to view the generated xml right in scenebuilder. I have it open in my IDE and edit the code there. – Lars Sep 05 '14 at 17:24
  • 1
    SceneBuilder automatically detects changes on FXML files and reload it even if the preview is open. Eclipse should also reload a file if a change where saved. – Vertex Sep 05 '14 at 18:03

3 Answers3

3

Well for now, there is no such option to view the FXML from the Scene Builder. I can confirm it for Scene Builder 2.0.

Though this can be a great addition to Scene Builder(If not the split screen, just viewing the FXML). You can file a feature request here https://github.com/gluonhq/scenebuilder/issues.

ItachiUchiha
  • 36,135
  • 10
  • 122
  • 176
  • I agree, I will file the feature request as other than that, scene builder is rather good. Although I did have it fail to parse an fxml file once I added an fx:script block but maybe I'll do some more research before raising that. – ed_me Sep 06 '14 at 10:23
  • The only recommendation I can make as far as viewing the code live is to use Brackets, an web development text editor. It works with various languages. Whenever you hit save on scene builder, this text editor will automatically display the changes, assuming you have the fxml file open. I create my css for the UI here as well and when I save it, scene builder will display changes immediately – OzzyTheGiant Apr 09 '16 at 04:54
1

Use IntelliJ Community edition. It has a built in FXML editor that lets you switch between wysiwyg and code.

Michael Brown
  • 9,041
  • 1
  • 28
  • 37
-1

There actually is a way. Save your file and from the file explorer, open your .fxml file with an IDE, say VSCode