« JavaFX Tips and Tricks: Using Singleton Pattern to Share a Model | Main | Six Degrees of Bob Seger: A JavaFX Program that We'll Build Together »

April 07, 2009

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54f133d69883401156ffbbf6e970b

Listed below are links to weblogs that reference JavaFX Tips and Tricks: Invoking JavaFX Functions from Java:

Comments

Tadalafil

Note that to instantiate a Java class, you can use the new operator.

cell functions

I created the interface but I don't know how to get a reference to the javafx class in java.

Jim Weaver

"Hello I am new to javafx and i need some help to call javafx code from java. I created the interface but I don't know how to get a reference to the javafx class in java."

Loic,

To get the reference to the the JavaFX class in Java, I'm passing it to the constructor of the Java class, in this case named WindshieldUniverse:

function foo(): Void {
universe = new WindshieldUniverse(universeHandler);
}

Note that to instantiate a Java class, you can use the new operator.

Thanks,
Jim Weaver

Loic

Hello I am new to javafx and i need some help to call javafx code from java.
I created the interface but I don't know how to get a reference to the javafx class in java.

thank you for the help

Main.java
public class Main{

private JavaInterface ji;

public Main() {
//My problem
JavaInterface ji = new ????
}
public static void main(String args[]) {
new Main();
}
}

JavaInterface.java
public interface JavaInterface {
public Object createStage();
}
MyStage.fx
public class MyStage extends JavaInterface {

public override function createStage(): Object{

Stage {
title: "Application title"
width: 250
height: 80
scene: Scene {
content: Text {
font: Font {
size: 24
}
x: 10,
y: 30
content: "Application content"
}
}}}}

The comments to this entry are closed.