This chapter looks at the JavaFX statements that control the flow of execution within a JavaFX script—
throw. As you’ll see, the
while statement is almost identical to its Java equivalent, whereas the JavaFX
for statements are significantly more powerful because they can also be embedded in expressions. The second part of this chapter covers exception handling in JavaFX, which is less intrusive than it is in Java and is likely to be of relevance more to library implementers than to application developers.
The syntax of the JavaFX
if statement looks like this:
if (boolean expression) [then] statement [else statement]
In its simplest form, the
if statement lets you execute ...