Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload a JPanel?

I'm a java newbie... I need to know how to reload a JPanel? I extended the JPanel class and created a panel that will run in a cardlayout in an Applet. I want this panel to reload/refresh after the user clicks a button in this panel. I tried including the revalidate() and repaint() methods (methods I don't understand well) in the ActionListener for the button but nothing happened. Can anyone throw some light on how to correctly refresh the whole panel?

like image 537
JLA Avatar asked Jul 12 '13 06:07

JLA


1 Answers

This works fine for me. But after an other

_panel.revalidate();
_panel.repaint();
like image 99
M.K. Avatar answered Oct 05 '22 08:10

M.K.