I don't know of any books, but I wrote a 2d game in Java which I lifted from download from the Java Boutique website. At least in 2001 there were tons of games and you could download the source code.
Engineers from Oracle and software development toolmaker JetBrains may be joining forces to create a new, Java-based 2D rendering pipeline for the Mac operating system (macOS). They've been working on ...