top of page

Java Projects

A simple ToDo application using Java's swing library. A user can add Tasks by pressing the buttons as well as sort them by different criterias.​

I learned how to use swing and the sorts in collections, as well as how to use listeners. I also tried implementing the solution according to the MVC architecture, but according to the teacher of the class I could have done better with implementing the listeners.

image.png

Producer-Consumer Problem
Github Repo

Solving the producer-consumer problem.

There are workers who work, and upon reaching a certain energy level go to take a break, they must receive their drink in FIFO order. The Coffe Machine continuously creates drinks up until a limit and can only serve one drink per second. 

All workers and the coffe machine run on their own thread.

I learned alot about multi-threading and had to solve synchronization problems. I also learned how to use the different concurrent classes java offers, like ConcurrentLinkedQueue and others.

image.png

I created a snake game clone.

I got inspired by how unity works for the solution. I chose to create a matrix and then place a gameObject in each of the elements of the matrix. The gameObject class was the parent class to all objects that would be in the game like grass, snake (head and body), wall, and fruit. This was then sent to the GUI to update the frame.

 

For the snake movement I just made the head part move with player input. For the body parts I called a movement method on the last part of the body so it would take the position of the one in front and then tell that part to do the same unless the part in front was the head.

 

I tried to do multithreading so the gui and the game would run in separate threads but the java swing event dispatch thread caused too many issues and I wasn't able to get it to work.

This project helped me refine my skills regarding MVC architecture as well as leading to a deeper understanding of the object-oriented paradigm.

image_edited.jpg
bottom of page