我开始在Java中(我学习microedition),我得到这个错误:在下面的类“INT无法提领”:INT无法提领
class DCanvas extends Canvas{
public DCanvas(){
}
public void drawString(String str, int x, int y, int r, int g, int b){
g.setColor(r, g, b); //The error is here
g.drawString(str, x, y, 0); //and here
}
public void paint(Graphics g){
g.setColor(100, 100, 220);
g.fillRect(0, 0, getWidth(), getHeight());
}
}
什么我错在这里做? 那么我来自PHP和ECMAScripts,我能够通过我的函数参数这样我所以我真的不明白这个错误。
呃,谢谢你们,我完全没有注意到这个变量具有相同我的图形对象的名称,我认为问题是当试图重新传递函数参数到另一个函数(我知道,无意义= P),我忘了传递一个Graphics对象drawString方法。 – Delta 2010-03-08 14:59:42