Top "Graphics2d" questions

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

Why can't I access my panel's getWidth() and getHeight() functions?

I'm writing a simple program to test out basic GUI. The program prints a letter in the middle of the …

java swing jpanel keylistener graphics2d
Java Graphics.fillPolygon: How to also render right and bottom edges?

When drawing polygons, Java2D leaves off the right and bottom edges. I understand why this is done. However, I …

java graphics polygon graphics2d edges
Java - Creating an image

I'm currently working on a game in Java and am trying to create a background without using any image files. …

java image graphics2d
Java image rotation with AffineTransform outputs black image, but works well when resized

I am just trying to rotate a JPG file by 90 degrees. However my code outputs image (BufferedImage) that is completely …

java graphics2d
Java: Graphics or Graphics2D?

I am new to Java and have been trying to make some simple games in it with lots of images …

java graphics graphics2d
How can I draw a rectangle towards the top of the application in java

How can I draw a rectangle towards the top of the application in java ? Normally the drawRect method draws towards …

java swing awt graphics2d
Swing HTML drawString

I'm trying to create some special component for a specific purpose, on that component I need to draw a HTML …

java html swing graphics2d jcomponent
How to increase Graphics2D text quality?

I have a question concerning printing additional information on barcodes. I am using http://barbecue.sourceforge.net/ to create my …

java rendering barcode graphics2d text-rendering
Drawing text with outline in java

I'm working with graphcis2d in Java and am currently using this to draw text into a bufferedImage Font font1 = …

java swing fonts arabic graphics2d
Java - Filling a Custom Shape

I have created a custom shape, essentially it is a collection of four Arc2D objects. When these arcs are …

java swing awt graphics2d