How to display JFreeChart in Java Swing GUI?

A little searching suggests that: A JFreeChart instance can also be added to a ChartPanel. The ChartPanel extends JPanel so can be added to a JFrame (JApplet, JDialog, JWindow, JPanel, JDesktopPane ..).

Thanks for your help. How would I go about setting a chart to be displayed in the ChartPanel though? – The Crazy Chimp Oct 23 at 19:54 ChartPanel is component in the JFreeChart that you create an pass on the chart object.

Afterwards you can use it as any other panel while adding to frame. – AKJ Oct 23 at 19:58 1 Can you read JavaDocs? Look particularly at the constructors for ChartPanel.

– Andrew Thompson Oct 23 at 20:01.

Check this little example, if you want to stick to ChartFrame, which should work too. I would also go for a JPanel approach, like Andew suggested.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions