The best way to work on a joint project is generally to do "pair programming", where both people are sitting together at the same computer, talking through the code as they write it together.
There are some fancier tools (e.g. git) for remote collaboration on the same code (e.g., for teams of 3 or more people) but they are generally challenging to learn.
There are also some online IDEs that would allow simultaneous editing, but I don't know of any that support Graphics (DrawingPanel).
I suppose you and your partner could use something like DropBox, which syncs up files between two computers, and it would be less annoying that Google Drive, but you still couldn't both edit the same file at the same time.
Both Google Drive & DropBox provide backup versions of the files that get overwritten, so you could roll back changes if necessary.
In general, the problem of merging together source code that two people have written is not an easy one to solve.