Skip to main content

this. in JavaFX

2 replies [Last post]
wildhias
Offline
Joined: 2008-11-04

Is there a already working mehtod of selfreferencing in javafx just like "this." in Java?

kind regards

wildhias

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kram
Offline
Joined: 2007-10-23

I believe you can use [b]this[/b] just like in Java... have you tried [b]this [/b]and it failed?

wildhias
Offline
Joined: 2008-11-04

No this doesn't work that way anymore. But in know how it apperently can work. you need to define 'var self' (no colon!), this reference to the calling object itself - but it is of the type Object, you then need to typecast it and can work with it via (self as ..TypeofFile).