Refactored JPanel to remove threads and implement the new Sprite class