anyone here knows how to rotate an icon in Java?
Dhruv Gairola -3 Junior Poster in Training
Recommended Answers
Jump to PostI don't, but this guy does :)
Jump to PostAffineTransform.
You create an instance of AffineTransform that maps the rotation you want and apply that to a Graphics2D instance with setTransform(...). Paint your icon to the Graphics2D and hey-presto, you have a rotated icon.
Here's a quick intro:
http://www.javareference.com/jrexamples/viewexample.jsp?id=88
All 5 Replies
apines 116 Practically a Master Poster Featured Poster
Dhruv Gairola -3 Junior Poster in Training
Dhruv Gairola -3 Junior Poster in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Dhruv Gairola -3 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.