1 43 44 package org.jfree.chart; 45 46 import javax.swing.JFrame ; 47 import javax.swing.JScrollPane ; 48 import javax.swing.WindowConstants ; 49 50 53 public class ChartFrame extends JFrame { 54 55 56 private ChartPanel chartPanel; 57 58 64 public ChartFrame(String title, JFreeChart chart) { 65 this(title, chart, false); 66 } 67 68 76 public ChartFrame(String title, JFreeChart chart, boolean scrollPane) { 77 super(title); 78 setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 79 this.chartPanel = new ChartPanel(chart); 80 if (scrollPane) { 81 setContentPane(new JScrollPane (this.chartPanel)); 82 } 83 else { 84 setContentPane(this.chartPanel); 85 } 86 } 87 88 93 public ChartPanel getChartPanel() { 94 return this.chartPanel; 95 } 96 97 } 98 | Popular Tags |