University project — 3rd year, Observer Design Pattern
Team: Vleju Cosmin Eugen, Slătineanu Andreea-Elena
A social network simulator built in Java Swing with cartoon characters as users. It's an implementation of the Observer design pattern — characters post content, and followers get notified in real time when someone they follow publishes something.
The feed shows posts from Tom (Tom & Jerry), Jake and Princess Bubblegum (Adventure Time), Gumball and Darwin (The Amazing World of Gumball). You can follow/unfollow, like posts (custom heart icon drawn with Java2D Bezier curves), and leave comments (animated slide-in section).
The follow system uses a custom Observer pattern — each character is a Subject with its own list of Observers. When you hit Follow, both the Followers window and the button itself update instantly, without the character knowing who follows it.
- Subject — each character (
FollowSubject) holds a list of observers and a follow/unfollow state - Observers — the
FollowButtontoggles its label, and aFollowerobject adds/removes the name from the Following window - When you click Follow,
setFollowed()triggersnotifyObservers(), which callsupdate()on everything attached
The UI is a 400×600 phone-like window with scrollable feed, profile pics, post images, follow buttons, likes, and a bottom nav bar. Custom drawn heart icon for likes (empty/filled states), smooth comment section animation, and an animated scroll-to-top button.
git clone https://github.com/papadie23/CartoonGram.git
cd CartoonGram
# Compile (requires JDK)
javac -d bin src/pk1/*.java
# Run
java -cp bin pk1.GUIinitOpens a 400×600 Swing window.
Java, Swing, Java2D, custom Observer pattern
Part of our 3rd year software engineering coursework — to understand how the Observer pattern works under the hood, applied to something fun rather than a boring tutorial example.





