tags:

views:

27

answers:

1

Can JavaFX refresh part of the page? Example, rearrange the top scorer in scoreboard like AJAX?

A: 

If you're implying that you want to refresh part of a web page, then the only way to get a JavaFX running on a webpage is to distribute it as a Java applet. You can make Javascript calls from JavaFX (see here for example) however I would argue that in most cases you'd want to avoid mixing applets and Javascript unless you have a very good reason to do so.

If you want to stick with JavaFX, then I would recommend trying to write the whole app with JavaFX and distributing as an applet, but be warned that there are still many criticisms of the user experience with JavaFX and applets, thought it has been done.

In answer to your question, assuming you had written a complete JavaFX app, then refreshing part of the app "page" would be trivial.

Matthew Hegarty
many thanks. so if i would like to rearrange the position of the new top scorer i would have to make it as Java applet? what does it mean by distribute it as a Java applet? and i am unable to view the winterolympics page. it says error that application failed to run.
JCX
applets are one option - as there are multiple client side technologies you could use, including Ajax. It's up to you to read up on the pros and cons of each.You can use a tool like Netbeans to create a JavaFX applet, then drop the resources (ie jar) on to a web server - there are Netbeans tutorials for this.The fact that you can't see the applet gives you first hand experience of some of the disadvantages of using applets :-)
Matthew Hegarty