jfreechart panelChart找不到符号

jfreechart panelChart can't find symbol

所以我已经将以下内容导入到所需的库中。但是 panelChart 找不到符号。尝试在桌面上创建一个新文件,然后从桌面上的文件复制,但它仍然无效。试过绝对路径,也没有改变任何东西。

hamcrest-core-1.3.jar
jcommon-1.0.23.jar
jfreechart-1.0.19-experimental.jar
jfreechart-1.0.19-swt.jar
jfreechart-1.0.19.jar
jfreesvg-2.0.jar
junit-4.11.jar
orsoncharts-1.4-eval-nofx.jar
orsonpdf-1.6-eval.jar
servlet.jar
swtgraphics2d.jar

此外,已经直接将以下内容导入class。

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;

panelChart.removeALL();
panelChart.add(barPanel,BorderLayout.CENTER );
panelChart.validate();

panelChart 带有红色下划线

我正在关注一个 video guide,但我没有意识到他已将他的 JPanel 从默认名称重命名为 panelChart。如果您正在关注类似的视频并且 运行 遇到相同的问题,只需将变量名称从通常的 jPanel1jPanel2 等更改为 panelChart [=16] =]