public void paintComponent(Graphics g){
        // Draw the background image on the panel
        if(firstPage){
            g.drawImage(background, 0, 0, this.getWidth(), this.getHeight(), this);
        }
        else if(secondPage){
            g.drawImage(background2, 0, 0, this.getWidth(), this.getHeight(), this);
        }
        else if(thirdPage){
            g.drawImage(background3, 0, 0, this.getWidth(), this.getHeight(), this);
        }
        repaint();
    }