Gerhard Heil

Greenhorn
+ Follow
since Dec 19, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Gerhard Heil

I still don´t see what to do.

Should I strictly follow the description "Deployment in the browser"? Do I need the dtjava.App object? Where should I create that? In the javascritp tag in the HTML page or in the JavaFx application code? In which class / method?

Do I need a working jnlp file for starting the application inside the browser? All the examples in chapter 5.3.1 in that description refer a jnlp file. NetBeans creates a jnlp file, but starting via WebStart does also not work.

Best regards
Gerhard
6 years ago
Hello,

ok, I really read JavaFx script, where Igor wrote Javascript.

So Javascript is compatible with JavaFx 2.0, and to invoke my application inside a browser, I need a HTML page with a Javascript tag, right?

If so, I feel I am one step further. But I still don´t see exactly what to do. Strictly follow the description "Deployment in the browser"? Do I need the dtjava.App object? Where should I create that? In the javascritp tag in the HTML page or in the JavaFx application code? In which class / method?

Do I need a working jnlp file for starting the application inside the browser? All the examples in chapter 5.3.1 in that description refer a jnlp file.

Best regards
Gerhard
6 years ago
Hello Darryl,

some weeks ago I found the Oracle tutorial http://docs.oracle.com/javafx/2.0/deployment/deployment_toolkit.htm#BABJHEJA what explains:
Creating a dtjava.App Object:
var app = new dtjava.App( ... );

I had seen that syntax in some JavaFx 1.x descriptions, but not in JavaFx 2.0. And I did not find any definition of dtjava.App. So I am not sure whether this dtjava.App object is to be created in the JavaFx code or in the HTML page.

I had posted the same query earlier in Oracle JavaFx forum (https://forums.oracle.com/forums/thread.jspa?messageID=10008333) and there I wrote my assumption of Javafx script, and got the confirmation:
What you are looking at in the guide is Deployment Toolkit and it uses javascript syntax, not javafx. ...
Start with getting started section (http://docs.oracle.com/javafx/2.0/deployment/deploy_quick_start.htm#BABJCFHC) and use javafxpackager
(or better ant task) to package app.
But easiest way would be install Netbeans 7.1 and use JavaFX project there. It will use ant task behind the scene to generate all package files.

I tried following the getting started section; this describes an ant task <fx:deploy ...>. As I use NetBeans, I included the fx:deploy task in my build-impl.xml, but NetBeans rejects it as the name fx:deploy is unknown (though I have defined the fx namespace). Maybe I have a syntax error somewhere or need to define the namespace somewhere else or whatever, so perhaps I could succeed the fx:deploy after any correction. Or maybe NetBeans does it easier, if I only find out what to enter in the project properties.

But once I have run the fx:deploy task successfully or once NetBeans has generated all required files, I assume I need any way to invoke the JavaFx application from the browser. The browser loads a HTML page, and how is the JavaFx application referred there? The examples 5-3, 5-4 and 5-5 in http://docs.oracle.com/javafx/2.0/deployment/deployment_toolkit.htm#BABJHEJA describe inserting a <script> tag in a HTML page. I assume the syntax of that tag might be different for a JavaFx 2.0 application, but the concept of inserting a <script> tag (or perhaps some other tag) in the HTML file looks ok. What is the correct way of referring the application? And what do I have to do to get the application loadable?

Thanky for your support. I wish you a merry Christmas and a happy new year.
Best regards
Gerhard
6 years ago
Hello,

obviously the post that I sent yesterday, was not stored in the forum database. Here once more:

The deployment chapter in the mentioned document describes the deployment of JavaFx Script, not JavaFx 2.0 (at least I understood so and a post in the Oracle JavaFx forum stated that also). Maybe I need only to change a little detail from that description.

Nevertheless I tried to follow that description and wrote a task <fx:deploy> in build-impl.xml (together with defining fx namespace), but NetBeans rejected this, as the name fx:deploy is unknown!

Besides that I got this hint in that forum: But easiest way would be install Netbeans 7.1 and use JavaFX project there. It will use ant task behind the scene to generate all package files. Indeed, NetBeans generates a jnlp file and a html file with a Launch button referring the jnlp. Launching via this jnlp throws an exception, but that is another discussion. If it would work, it would open a new window for the launched application.

In this thread I am asking about starting the application inside the browser (as an applet if that is the correct term). I imagine it would (from users point of view) look and behave like a HTML page containing JSF or Facelets components. I assume for that I would need a HTML file containing something like or similar to
<script>
function deployIt() { ...
}
</script>

But I did not find out what to write in the HTML file. Do I need anything else in the application coding (for example setting an id that would be referred in the HTML tag), in the build.xml or build-impl.xml or somewhere else? Is there any detailed and working description how to implement the promised JavaFx feature of starting the application inside a browser?

Thank you for your help.

Best regards
Gerhard
6 years ago
Hello Trupti,

I am a JavaFx newbie also; it looks as if your application is a my JavaFx game (a kind of Sokoban game). I have a grid of 22 * 22 tiles, located at certain positions:

ImageView le_buildingView[][] = new ImageView[22][22];
for (nRow = 0; nRow < 22; nRow++) {
for (nCol = 0; nCol < 22; nCol++) {
le_buildingView[nCol][nRow] = new ImageView ();
le_buildingView[nCol][nRow].setX (nCol * 26 + 178);
le_buildingView[nCol][nRow].setY (nRow * 26 + 40);

leView.getChildren ().add (le_buildingView[nCol][nRow]);
6 years ago
Hello all,

I am a JavaFx newbie (and I am not a HTML or script expert). I am implementing my first JavaFx application (JavaFx 2.0) and I succeeded to get it startable out of NetBeans (by Run Main project) and, without NetBeans, by click on the jar file. That works fine.

JavaFx feature description says that a JavaFx application is startable
1) standalone
2) within a browser
3) via WebStart

So as next step I want to get it started within a browser; as I understood the feature description, I would have to include a JavaScript tag (or anything else) into a HTML page, so the JavaFx application would be embedded within the browser window, looking similar to active components like JSP, JSF etc. Is that correct? From Oracle JavaFx forum, I got the hint to use NetBeans, that would generate all package files.

In fact, NetBeans generates a launch.jnlp file and a launch.html file referring this jnlp (for the WebStart), but it does not generate a HTML file, and I have no idea what to write.

I also tried to insert a tag <fx:deploy ...> within build-impl.xml, with definition of xmlns:fx, but that is not even compilable (Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:deploy; Cause: The name is undefined).

I also read the Oracle deployment tutorial, but that describes JavaFx 1.3 and that is not compatible to JavaFx 2.0 (or I followed it somehow incorrect). So what is to be done to get the JafaFx 2.0 application started within the browser? What do I have to write in a HTML page? And what do I have to specify in NetBeans project properties or in the build.xml or build-inpl.xml (if that requires any certain settings)?

The tools I currently use are:
NetBeans 7.1 RC1
JavaFx_2.0_SDK
Java JRE 7

Thank you very much for any support.

Best regards
Gerhard
6 years ago