Duplicate :
|
Image.getGraphics() throws an IllegalAccessError when called for a non-off-screen image. The spec does not state what error/exception should be thrown in this case, only that the getGraphics() method can only be called for off-screen images. An IllegalAccessError seems kind of harsh, it may make more sense to throw an UnsupportedOperationException. The spec should also probably be updated to state which exception should be thrown.
|