repaint() in static method
843806Aug 14 2007 — edited Aug 14 2007I suppose this is a stupid question, but is there any way of using something like "repaint()" inside a static method?
I am making a little game and I have a JFrame (the main frame) that contains a JPanel for every screen (i.e. the start menu, play screen, ...). Now I want to force the main frame to repaint the JPanel that is currently loaded inside the JFrame. The problem is that the JPanel is created by the previous JPanel that was displayed, so I can't call it directly from the main frame. I thought I could make a static method in the JPanel that repaints the panel, but I don't think this is possible... Any suggestions?