Fandom

Planet JFX

Magic Constants

118pages on
this wiki
Add New Page
Talk0 Share
  • __DIR__ -- returns the URL of the directory that contains the current FX source file. This may be a JAR url if the current file was loaded from a jar file.
  • __FILE__ -- returns the URL of the current (class) file.
  • __PROFILE__ -- is either one of "mobile", "desktop" or "browser" depending on which environment the script is executing in (but raises a compile error).

Example Edit

import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.text.*;

Stage {
    title  : 'Magic Constants'
    scene  : Scene {
        width  : 500
        height : 200
        content: Text {
            x: 10, y: 50
            content:
                "__DIR__: {__DIR__}\n"
                "__FILE__: {__FILE__}\n"
        }
    }
}

Links Edit

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