无法编译此代码,我收到一条错误消息:
invalid method declaration;
return type required public MineFinderFrame(int nc, int nr,int mod)
请问有人可以修改我的代码吗?
class MineFinderPanel extends JPanel implements MouseListener
{
int numCols;
int numRows;
int myModel;
public static void main(String[] args)
{
MineFinderFrame w = new MineFinderFrame(30,50,42);
w.numRows = 50; // 50 rows
w.numCols = 20; // 20 columns
w.myModel = 42;
w.setVisible(true);
}
public MineFinderFrame(int nc, int nr,int mod)
{
numCols = nc;
numRows = nr;
myModel = mod;
addMouseListener(this);
}