Java Swing Animation Project: Holiday Greeting Card (everything drawn and animated using code)

Опубликовано: 12 Октябрь 2024
на канале: tutorials101videos
5,345
29

Hey, all! I'm currently learning Java, and over the break, my teacher had us do an animated greeting card. But we weren't allowed to use any images. Everything had to be drawn and animated using code! Here's a screen capture of my completed work. Thought I'd post it to give you all my belated holiday greeting! Have a great year, everyone! :)

Background music made using GarageBand.

JAVA classes used:
JFrame
JComponent
javax Swing Timer for the animation
Graphics2D for drawing
AffineTransform to keep track of the rotation animation
Ellipse2D to create circles that accept doubles for coordinates and size
Rectangle2D
Path2D for creating shapes with rounded edges
Line2D
GeneralPath
RenderingHints to smoothen out lines and curves

JAVA Interfaces implemented:
ActionListener for the timers used for the animation
MouseMotionListener for the start screen where the snowman's arms follow the mouse
MouseListener

#JavaAnimation #JavaSwing #JavaProgramming