paintComponent() good standars' programming

Hi ,
This is my question , for example I would create a game , and would paint when I win a match a screen with “You win” , generally I, for do this, use a boolean variable in paintComponent method :


public void paintComponent(Graphics g){
      if(game_is_running) // paint the game state 
      else // paint the screen with the string "you have win "

With this approach all work , but I’ve read on web that into paintComponent must not use boolean variable because paintComponent must paint only the game state… So I don’t know how…