I have a drawing board with some circles, triangles and rectangles. I want to be able to set them visible and not.
The classes name are
Triangle c = null;
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
Please use :
Triangle c = new Triangle();
Instead of null
Reference variables with null value will always give you NullPointerException when you call it with dot(.) operator.