Here is another example, similar to aussiemcgr's example:

public void paint(Graphics g) {
.........
drawMaze((Graphics2D) g);
.........
}
private void drawMaze(Graphics2D...