Top "Graphics2d" questions

Graphics2D is the part of the Java 2D API related to two-dimensional graphics, text, and imaging capabilities.

Drawing a line on a JFrame

I am trying to draw a line using the Graphics 2D but then the line appears over all the other …

java swing jframe graphics2d
How can I center Graphics.drawString() in Java?

I'm currently working on the menu system for my Java game, and I wonder how I can center the text …

java text draw centering graphics2d
Flip Image with Graphics2D

I've been trying to figure out how to flip an image for a while, but haven't figured out yet. I'm …

java image swing graphics2d
Set BufferedImage to be a color in Java

I need to create a rectangular BufferedImage with a specified background color, draw some pattern on the background and save …

java image graphics bufferedimage graphics2d
Problems with newline in Graphics2D.drawString

g2 is an instance of the class Graphics2D. I'd like to be able to draw multi-line text, but that …

java string newline graphics2d
How to rotate text with Graphics2D in Java?

I want to rotate text on a JPanel using Graphics2D.. My code is this: double paso=d.width/numeroBarras; …

java awt graphics2d
Drawing Transparent Images In Java Graphics2D

I want to draw a PARTIALLY transparent image on top of another (Making shadows over things). I am currently using …

java transparent graphics2d
Painting pixels images in Java

Which method is the best way to create a pixel image with java. Say, I want to create a pixel …

java swing pixel graphics2d paintcomponent
java rotate rectangle around the center

I would like to rotate a rectangle around its center point and it should remain in the place that it …

java graphics rotation graphics2d affinetransform
Rotating Image with AffineTransform

I have got class called Airplane. Inside this class i have got variable img which is a BufferedImage type. What …

java swing graphics2d image-rotation affinetransform