|
| ||||||||||
| Tags: collections, hashmap, hastable, list, map, tools, utilities |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Problem in <Shape> List
I have a class that derives from JPanel where we draw the curve Graph, I have inserted a private attribute Code: Public Class Gra{ ....
private List <Shape> shapes;
...} Code: sh = new ArrayList <Shape>(); / / Collection form used to break |
|
#2
| ||||
| ||||
| 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]));
}
} |
|
#3
| |||
| |||
| 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 () |
|
#4
| |||
| |||
| 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(); |
|
#5
| |||
| |||
| 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 (); |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Problem in <Shape> List" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cursor Shape And Size | hatred | Windows XP Support | 3 | 26-09-2011 07:20 PM |
| Shape interface of java | Gajananvihari | Software Development | 4 | 09-03-2010 04:08 PM |
| Fitness game test your shape | Chandranath | Video Games | 5 | 30-12-2009 04:52 AM |
| Changing the Cursor shape in Java | rashmi_ay | Software Development | 4 | 30-11-2009 09:58 AM |
| Multi Shape Cobra Stand for PSP | Alexxx | Portable Devices | 3 | 26-03-2009 11:10 PM |