Graphics2d « Applet « Java Swing Q&A





1. Java Swing: Graphics2D rotation creating disgusting edges    stackoverflow.com

Hi all I'm having a problem with the rotation of images

Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
AffineTransform at = new AffineTransform();
at.setToIdentity();
at.translate(x, y);
at.rotate(Math.toRadians(angle));
g2.transform(at);
image.paintIcon(c, g2);
I use this code to rotate the picture before painting it (image ...

2. How to move the image inside the JApplet in vertical line?    stackoverflow.com

I have displayed an image(ball) inside the JApplet, now I want the image to move in a vertical way (up and down). The problem is I don't know how to ...