我有一个名为 sagum 的类,它有一个方法名 paint
public void paint(Graphics g) {
int[] apw1 = null;
int n1 = 0;
for (int j = 1; j <= n1; j++) {
g.drawRect(50, 50, (apw1[j] * 20), 30);
String[] p = null;
g.drawString("p" + p[j - 1], (55 + (apw1[j - 1] * 20)), 70);
g.drawString("" + apw1[j - 1], 50 + (apw1[j - 1] * 20), 100);
}
g.drawString("" + apw1[n1], 50 + (apw1[n1] * 20), 100);
}
我想打电话给它
n1=count+1;
paint(g);
我得到一个错误
non-static method paint(Graphics) cannot be referenced from a static context
我只是在执行方法后尝试调用它来执行我的方法的图形应用程序(调度算法)。
请帮忙