Re: Problem in <Shape> List
Hello,
I am new to java, but I have done a program, keeping your needs in mind. Just check out the code and see if this works with you.
Code:
Public View Point(){ .....
if(ok){
g.drawLine(num-1+ x, tab_coor[indiceTab -(int)not][i][0], num + x, tab_coor[indiceTab][i][0]);
shapes.add(new Line2D.Double(num-1+ x, tab_coor[indiceTab -(int)not][i][0], num + x, tab_coor[indiceTab][i][0]));
}
....
if(ok){
{g.drawLine(num-1+ x, tab_coor[indiceTab -(int)not][i][c], num + x, tab_coor[indiceTab][i][c]);
shapes.add(new Line2D.Double(num-1+ x, tab_coor[indiceTab -(int)not][i][c], num + x, tab_coor[indiceTab][i][c]));
}
}
Re: Problem in <Shape> List
Hello,
I think if you need you can use the following methods in your code.
Code:
a.getfenfraph ()
a.getfenfraph (). getGraphePh ()
Simply add System.out to determine which is the standard output you want in your code. If you have any more problem regarding this topic then please do post back and we will try to solve it.
Re: Problem in <Shape> List
Hello,
Yes, I agree with the above posted, you can do it.
Here is an sample example
Code:
System.out.System.out.println( a);
System.out.System.out.println( a.getfenfraph());
System.out.System.out.println( a.getfenfraph().getGraphePh());
sh = a.getfenfraph().getGraphePh().getmesShapes();
It does not fix the bug But it will know which element is null. Hope this method will help you in your code.
Re: Problem in <Shape> List
Hello,
Uncomment this line to your constructor, you have done a mistake there, this may cause a problem when you are trying to compile the program or you can get an undesired the results
Code:
/ / List <Shape>sh <Shape> = new ArrayList ();
In fact your list is initialized at any time, hence the NullPointerException that you get. I guess you will correct is soon.