Using FXGraphics2D to display JFrame

A discussion forum for FXGraphics2D (adds a Java2D API to the JavaFX Canvas).

Using FXGraphics2D to display JFrame

Postby jfriday » Tue Jun 10, 2014 3:31 pm

I'm new to both JFreeChart and JavaFX (though have used Java and Swing for a few years). I am trying to create an application that is built upon JavaFX and uses JFreeChart to display a bubbleChart. Is it possible to use FXGraphics2D to act as a bridge between JavaFX and JFrame containing the JSplitPane? If so, how would one accomplish this? Thank you for the help.
jfriday
 
Posts: 1
Joined: Tue Jun 10, 2014 3:24 pm

Re: Using FXGraphics2D to display JFrame

Postby david.gilbert » Tue Jun 10, 2014 6:03 pm

You can look through the JFreeChart demo that is included with the FXGraphics2D download. Here is a link to the source file:

https://github.com/jfree/fxgraphics2d/b ... Demo1.java

You'll see at line 70 that there is a very basic ChartCanvas class that extends Canvas and is therefore a Node. You can place that anywhere in your JavaFX UI. The role of FXGraphics2D is *within* that chart canvas, to translate the JFreeChart drawing calls (which use the Graphics2D API) to the equivalent JavaFX Canvas rendering.

When I have time I plan to create a more full-featured ChartCanvas that supports some of the features that are found in the existing ChartPanel class that you can use in a Swing UI. This has been done for the Orson Charts viewer, but I didn't get to the JFreeChart one yet.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11623
Joined: Fri Mar 14, 2003 10:29 am

Re: Using FXGraphics2D to display JFrame

Postby benty » Mon Dec 29, 2014 5:46 am

Hi david.gilbert, I am new to this forum..Actually i was not aware of FXgraphics2D....Where the method of FXGraphics to used???That i can't under..I am waiting for the reply..Keep in touch with us..Thanks for your information :lol: :lol:
benty
 
Posts: 2
Joined: Mon Dec 29, 2014 5:26 am
Location: Europe


Return to FXGraphics2D

Who is online

Users browsing this forum: ivangaev, kiradoc and 2 guests