Graphics2D object

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sido

Graphics2D object

Post by sido » Fri Apr 05, 2002 2:50 pm

hi,
i need a Graphics2D to draw:

chart.draw(Graphics2D g2, Rectangle2D chartArea, DrawInfo info);

but i don't know hwo create a Graphics2D object??

thanks fo help,
sido

sido

Re: Graphics2D object

Post by sido » Fri Apr 05, 2002 3:52 pm

i found a solution:

Graphics2D graphics2D = (Graphics2D) graphics;

now, i have a problem with the Component:

Component component = new Component() ;
Graphics graphics = component.getGraphics();
Graphics2D graphics2D = (Graphics2D) graphics;

the class Compnent is abstract and the constructor has protected access...
i don't know woh to do!

sido

David Gilbert

Re: Graphics2D object

Post by David Gilbert » Fri Apr 05, 2002 5:14 pm

You should use the JFreeChartPanel class to display your charts in a GUI...it takes care of all that for you.

Regards,

DG.

Locked