ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  JavaFX 2.0 Sample
Posted by Kumar on Nov-20-2011 17:21
Peter, Any guidance on how to use ChartDirector for Java in JavaFx 2.0 ? Do you have a simple Sample code ? Basically I am trying to create a MultiChart and try to assign my.makeImage() to the javafx scene. The problem is makeImage returns AWT image which the javafx scene does not like. Any working sample you have ?

  Re: JavaFX 2.0 Sample
Posted by Peter Kwan on Nov-22-2011 02:02
Hi Kumar,

You may consider to use the following method to create an FXImage from a java.awt.image.BufferedImage.

http://download.oracle.com/docs/cd/E17802_01/javafx/javafx/1.2/docs/api/javafx.ext.swing/javafx.ext.swing.SwingUtils.html

The BaseChart.makeImage outputs a java.awt.image.Image, but you can cast it into a java.awt.image.BufferedImage. It can then be passed to toFXImage to change to an FXImage.

Hope this can help.

Regards
Peter Kwan