Hey, I've uploaded my program, so that you can test it, seeing as pasting large chunks of code wont let you see what my problem is.
In MyControlPanel class I have this line:
DrawShape drawShape = new DrawShape(20,20,shapeSize,theShape);
Which is used to send the coords 'x' and 'y', 'shapeSize' and 'theShape' to the DrawShape class
I then have a paintComponent which is used to draw one of the three shapes depending on which is chosen from the menu, for example if the Square is chosen, a square will be drawn, using the coords x and y(default 20,20) and also the shapeSize(taken from the sliders value)
but, before it draws a shape it needs to recognize which shape has been chosen, seeing as I have passed in myShape, and assigned it to theShape, I should be able to, some how, compare 'theShape' to 'Circle' and if it matches it will drawn a circle, etc.
I tried using:
if(theShape == Square)
but then found that i cant just simply do that.
Can anyone help me ? how do i check to see which shape it is that has been chosen.
It would be much easier if you downloaded my program, if possible.
I will post all the code if needed.