*這個問題是不是重複其符號「非靜態方法不能從靜態上下文中引用?」,它涵蓋了不同的錯誤信息,這是「無法找到符號」。模糊編譯器錯誤「無法找到符號」,但沒有指定
我在與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? –