wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Any one knows how to add a JFreeChart into a JScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Any one knows how to add a JFreeChart into a JScrollPane" Watch "Any one knows how to add a JFreeChart into a JScrollPane" New topic
Author

Any one knows how to add a JFreeChart into a JScrollPane

Tan xiaolong
Greenhorn

Joined: May 09, 2013
Posts: 2
i check the JFreechart javadoc http://www.jfree.org/jfreechart/api/javadoc/index.html
it says that:
public ChartFrame(java.lang.String title,
JFreeChart chart,
boolean scrollPane)
Constructs a frame for a chart.
Parameters:
title - the frame title.
chart - the chart.
scrollPane - if true, put the Chart(Panel) into a JScrollPane.

but i do not know how to realize it...

as the Attachments shows...

please help me..thank you~
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1089
    
  10

Hi Tan,
Welcome to the Ranch!

JFreeChart has a class ChartPanel which I think extends JPanel. So, you create an instance of that and add it to the JFrame in the usual way.
You can add the ChartPanel itself to a JScrollPane too...


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Tan xiaolong
Greenhorn

Joined: May 09, 2013
Posts: 2
Ranganathan Kaliyur Mannar wrote:Hi Tan,
Welcome to the Ranch!

JFreeChart has a class ChartPanel which I think extends JPanel. So, you create an instance of that and add it to the JFrame in the usual way.
You can add the ChartPanel itself to a JScrollPane too...



i learned from some e.g.s

here's my code for who needed




tip: attention to your panel LAYOUT,or you won't see it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Any one knows how to add a JFreeChart into a JScrollPane