我在我的java程序中使用以下行
LegendItem item1 = new LegendItem("US", "US", "US", "US", new Rectangle(10, 10), new GradientPaint(0.0f, 0.0f, new Color(16, 89, 172), 0.0f, 0.0f, new Color(201, 201, 244)));
cannot find symbol symbol: constructor LegendItem(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.awt.Rectangle,java.awt.GradientPaint) location: class org.jfree.chart.LegendItem
答案 0 :(得分:0)
编译&执行正常,在类路径中使用jfreechart-1.0.3.jar
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Rectangle;
import org.jfree.chart.LegendItem;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
LegendItem item1 = new LegendItem("US", "US", "US", "US",
new Rectangle(10, 10), new GradientPaint(0.0f, 0.0f,
new Color(16, 89, 172), 0.0f, 0.0f, new Color(201, 201, 244)));
System.out.println(item1.getSeriesIndex());
}
}