我在此代码中遇到错误。
import java.awt.Color;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;
public void simplebarchart()
{
DefaultCategoryDataset dataset=new DefaultCategoryDataset() ;
dataset.setValue(80, "Marks", "Student1");
dataset.setValue(70, "Marks", "Student2");
dataset.setValue(65, "Marks", "Student3");
dataset.setValue(90, "Marks", "Student4");
JFreeChart c=ChartFactory.createBarChart("Student Score" ,"Student Name", "Marks",dataset,
PlotOrientation.VERTICAL, false, true, false);
CategoryPlot p=c.getCategoryPlot();
p.setRangeGridlinePaint(Color.BLACK);
ChartFrame frame=new ChartFrame("Bar Chart",c);
frame.setVisible(true);
frame.setSize(450, 350);
}
错误如下
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
org/jfree/util/PublicCloneable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
为什么我会收到此错误?