posted 15 years ago
I am learning some custom painting and I encounter some problems. I want to create a frame that when I click a button, the component of the frame get redraw. It worked, however, since I add all the components onto 1 panel, I cant control its layout. So I put every component onto a separate panel, and add all these panel to one main panel, and at the end, add that main panels to the frame. Now my paintComponent(Graphics g), dont work anymore. I think since I create multiple panel, when I call repaint(), it does not know what panel to repaint any more.
Here is when I only have one panel. Custom painting work fine
Here is the code with multiple panels. Custom painting stop working