Planet JFX

JavaFX's version of "this"

118pages on
this wiki
Add New Page
Talk0 Share

While instantiating an object with JavaFX's object literal notation, you can declare a "this" variable with a var: statement:

class Parent {
    attribute child: Child;

class Child {
    attribute parent: Parent;

var aParent = Parent {
    var: myself   // refers to the aParent reference 
                  // (which isn't available for use in the next block)
    child: Child {
        parent: myself
println("equal? {aParent == aParent.child.parent}");

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki