I still have the error of NullPointerException for the following code (to draw on the the panel just with mouse press and release). i have four classes, the error is at DrawPanel class when i create an object of class MyLine, i don't know why
the following is the main abstract class
but i first declared any array of points before the constructor as Point  points = new Point; which will be initiated in the constructor when the mouse is pressed and released. please, indicate more am i right!!
ok, i removed all this array and replaced it by integers for the coordintaes like integers x1, y1 and x2, y2 and the error is removed by still displaying the panel without the capablility for drawing lines, !!!
so, i replaced the line drawing using MyLline class object by the simple and it works but i want to use MyLine class object in my paint component method
thanks alot with your responses. i solved the problem which was in my MyLine class as i tried to use it directly where i should use it polymorphically as all the variables become a part of Shape class when i declared the the MyLine object in the DrawPanel class. i will convert the code then to use points instead of the exact integers. thanks again
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss