Yahoo Clever wird am 4. Mai 2021 (Eastern Time, Zeitzone US-Ostküste) eingestellt. Ab dem 20. April 2021 (Eastern Time) ist die Website von Yahoo Clever nur noch im reinen Lesemodus verfügbar. Andere Yahoo Produkte oder Dienste oder Ihr Yahoo Account sind von diesen Änderungen nicht betroffen. Auf dieser Hilfeseite finden Sie weitere Informationen zur Einstellung von Yahoo Clever und dazu, wie Sie Ihre Daten herunterladen.
how do you add or remove JPanel in Jframe during runtime(Java Question)?
I have three classes JFame,JPanel,LeftPane and ActionListener class.I have a button in LeftPane and i am trying to change the visibility or add or remove the JPanel from JFrame when the button is clicked. I have implemented the ActionListener to do this and then i wrote frame.validate to bring changes in Frame during runtime, but it doesnt work
Can anyone give me a small example how to do so or is there sourse code online please send me link
Thanks alot
1 Antwort
- Mark aka jack573Lv 7vor 1 JahrzehntBeste Antwort
You may be able to do 1 of 2 things.
1) get the content pane and do validate on that.
getContentPane().validate();
2) set the frame to invisible than visible
setVisible(false);
setVisible(true);