Because if you call it in your main method the Graphics object from the GUI might not be initialized yet. You've created a race situation because your main method is in one thread and the GUI (i assume it's a JFrame or something) runs in the GUI thread.
Thanks, I think that's why.