I just start learning java using netbean. I am now have one jFrame containing a jPanel1, and one jPanel2 class. I want to add jPanel2 into jPanel1 in jFrame in certain condition. So i've tried
if(split){
jPanel2 = new jPanel2();
jPanel1.add(jPanel2);
Panel1.setVisible(true);
}
I have searched over the internet and found out sort of methods to do this is using GridLayout,CardLayout or something . But i still can not do it like those tutorial even i did the same thing.Thanks so much , please don't mind for asking stupid question.