but complier tell me that Graphics is an abstract class, can not be instanced
of course, Graphics can't be instanciated directly. But you can use some other methods to create Graphics instance.For example, Graphics g = new JLabel("Hello World").getGraphics();there are many other methods such as create an image and then get the Graphics
can not be instanced
But you can use some other methods to create Graphics instance.For example, Graphics g = new JLabel("Hello World").getGraphics();there are many other methods such as create an image and then get the Graphics