0

I'm new to JavaFX, have a quick look at it, I wonder if we can run java code inside FXML markup file? Like we can do it with jsp file with block ?

4
  • I assume you mean "FXML"? Commented Feb 23, 2015 at 19:14
  • yes , sorry i was not clear enough Commented Feb 23, 2015 at 19:15
  • Could you edit the question and fix that? It will make it easier for others to find if they have the same question. Commented Feb 23, 2015 at 20:18
  • yes i will fix it, thank you for your comment Commented Feb 23, 2015 at 21:19

1 Answer 1

2

No. FXML is just markup that defines the layout. You can express bindings in FXML, and technically you can include Javascript for event handling, though I don't think anyone uses that for any real applications.

The dynamic aspects of the application are typically managed in a controller, which is a Java class. The FXML file can inject elements into the controller and nominate controller methods to be used as event handlers.

See the introduction to FMXL for details.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.