It just so happens that I'm also making my first game in Java so I'll try to help you out as much as I can. I haven't read that book yet though. Most of my knowledge is from playing around and reading on forums.
I don't understand your question though. Do you need help with the game loop or with the rendering? I'm guessing it's about the rendering looking at your code.
Since you're using a JFrame to draw your graphics on (as far as I know this is the best place to do it. I'm using the same.) I recommend overriding the "protected void paintComponent(Graphics g)" method. Place all your drawing code in there and in your game loop simply call "repaint();"
In the "paintComponent" method you can start drawing your graphics. If you're having trouble with this I sagest that you play around with some demo projects to get the hang of this.
Here is some code to import a png and draw it on the JPanel:
import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Driver extends JPanel
{
JFrame frame;
Image img;
BufferedImage backBuffer;
public static void main(String[] args)
{
Driver drive = new Driver();
drive.initialize();
}
private void initialize()
{
frame = new JFrame();
frame.setTitle("Main Menu");
frame.setSize(816, 638);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocation(500, 0);
frame.setLayout(new BorderLayout());
frame.add(this);
try
{
img = ImageIO.read(new File("pick.png"));
}
catch (IOException e)
{
e.printStackTrace();
}
frame.setVisible(true);
backBuffer = new BufferedImage( this.getSize().width, this.getSize().height, BufferedImage.TYPE_INT_RGB);
}
@Override
protected void paintComponent(Graphics g)
{
Graphics bbg = backBuffer.getGraphics();
int displayX = 10;
int displayY = 10;
int displayWidth = 20;
int displayHeight = 20;
bbg.drawImage(img, displayX, displayY, displayWidth, displayHeight, this);
g.drawImage(backBuffer, 0, 0, this);
}
}
I hope this helps you.
Best of luck with your game. I hope I'll be able to play it some day :)