Hello, Im trying to create an interface where I cant change the components of the without have to change frames. For example the main interface would have a empty jPanel in which I would add or remove other jPanels to. The other jPanels say for example one for login would be called from another class and all its components would load on the jpanel on the main interface. after the login button is clicked the login jpanel should be removed from the main and a new one placed in.
It doesnt seem to work..I just get a blank area where the panel should be but everything else in the frame seems fine..Im not sure if I should setVisible() somewhere..
Im not familiar with card layout..:/Im using netbeans..drag and drop...
Joined: Apr 20, 2011
I tried to change the add(component) part to jPanel1.add(crum, BorderLayout.CENTER);
now Im getting this new error, Im not sure if its related..
I don't know about the exception - sometimes class loading errors might be because you've spelt the class name wrong.
What layout manager are you using with your panel? JPanels have a FlowLayout by default, so trying to add something with BorderLayout parameters might cause problems. Also your code looks like it's from NetBeans, which uses something called a GroupLayout unless you tell it to use something else.