*这个问题是不是重复其符号“非静态方法不能从静态上下文中引用?”,它涵盖了不同的错误信息,这是“无法找到符号”。模糊编译器错误“无法找到符号”,但没有指定
我在与JCreator的显示生成错误error: cannot find symbol
,而不是指定什么符号中发现的问题。
代码:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class FanTest extends JFrame
{
public FanTest()
{
setLayout(new GridBagLayout());
//more stuff here
}
public void addCompsToGui(Container pane)
{
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
//more stuff here
}
public static void main(String[] args)
{
FanTest gui = new FanTest();
gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
gui.setSize(600,600);
gui.setTitle("Test Console for Fan");
addCompstoGui(gui.getContentPane()); // error pointing to this line
gui.setVisible(true);
}
}
这是功课,我只是在寻找与一个错误的帮助,它的分辨率
它是否给任何行号?我们需要更多的细节 – Ascalonian
行号是218,在行后面注释(从帖子底部开始第4个)。这就是编译器给我的所有细节 – Azulflame
stackTrace请因为在这里,我们不能确定哪一行是218? –