Implementing the "Battleships" game with Java and Swing