Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a Graphics2D instance?

What's the easiest way in Java SE 7 to obtain an instance just to plot a few points for debugging? Desktop environment.

like image 217
necromancer Avatar asked May 13 '13 23:05

necromancer


1 Answers

You could use a BufferedImage:

BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics2D = image.createGraphics();
like image 199
BLuFeNiX Avatar answered Sep 27 '22 17:09

BLuFeNiX