私が取り組んでいるコードのスニペットに問題があります。私はメインメソッドを含むクラスでJFrameを拡張しています。私はJavaの初心者です(大学で学び、それを使って練習しましたが、まだまだ立ち往生しています)。私は私のIDE、eclipse NEONがCOMPONENTに変換すると言っている、私のlocateメソッドで戻り値の型を持っています。私のコードは以下の通りです:JFrameを拡張した後のJavaでのエラーメッセージ
import javax.swing.JFrame;
public class Board extends JFrame
{
/**
*
*/
private static final long serialVersionUID = 1L;
boolean result;
int counter2;
int counter = 100000;
Point point = new Point(1,2,3);
int to_be_changed = 100000;
Point[] point2 = new Point[100000];
private int fortree = 0;
public static void main(String[] args)
{
Board bb = new Board();
int colChange = 1;
bb.add(1 ,0 ,1);
new work(bb);
}
public void add(int xco, int yco, int Colr)
{
point2[point2.length - counter] = new Point(xco, yco, Colr);
counter--;
counter2++;
}
public boolean Filled(int x1, int y1)
{
int i = 0;
do{
if (i > 100000){ i = 0; }
result = ((point2[i].getPoinx() == x1) && (point2[i].getPointy()== y1));
i++;
}while((result == false) && (i != counter2));
return result;
}
public Point locate(int x1, int y1)
{
Point backer = new Point(0,0,0);
for (int j = 0; ((j < point2.length) && (result == false) && (point2[j]) != null); j++)
{
if ((point2[j].getPoinx() == x1) && (point2[j].getPointy() == y1))
{
backer = point2[j];
result = true;
}
}
return backer;
}
public void setfortree()
{
this.fortree++;
}
public int getfortree()
{
return this.fortree;
}
}
class work
{
work(Board y)
{
Intelligence p = new Intelligence();
System.out.println(p.tree(0, 0, y, 1, 1));
}
}
誰かが何が起こっているのか教えてください。 ありがとうございました