Planet JFX

Magic Constants

118pages on
this wiki
Add New Page
Add New Page Talk0
  • __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
                "__DIR__: {__DIR__}\n"
                "__FILE__: {__FILE__}\n"

Links Edit

Also on Fandom

Random Wiki