Skip to main content

creation trigger in compiled JFX

2 replies [Last post]
Joined: 2008-06-23

Is there a new syntax for creation trigger? Or is there anything that can work as a constructor? i'm just giving values to class attributes whenever i declare a new objects, but it gets rough when there are so many attributes. Im just looking for a way around it.

btw, also Is there a new syntax for delete trigger?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-11-15

The init-construct can be used instead of a constructor. The usual way to create a new object and setting its attributes is by using an object-literal. And you can set the default values in the definition of an attribute. Don't know what you mean with "a way around it".

Do you mean creation- and delete-triggers in the context of sequences? The functionality of both can be implemented using only the on replace-trigger.

Joined: 2007-05-10

There is postinit block in JavaFX to provide constructor-related functionality.
For more information about postinit block take a look at James Weavers's JavaFX Blog.