Drawing in JPanel not working as expected

Printable View