I found this movie on youtube which helped me a lot:
Swing CardLayout in Netbeans - YouTube
But I have a problem. In this movie the author made two panels and a JFrame. Then he create a new category in pallete menu and name this category CardLayout and put inside this category the two panels created and so on..
Later he just connect everything and it works..
The point of connection is here:
private void ButtonClick(java.awt.event.ActionEvent evt) {
CardLayout card = (CardLayout) DisplayPannel.getLayout();
card.show(DisplayPannel, "first");
}
But the problem is that i would like let's say modify the panels which I add in the CardLayout category but they are locked or something..
My first question is:
Can I modify those Jpanels or when I put them in the category from pallet they become locked?
Second:
I just tried to made an another Jpanel and put in the Displaypanel but now I don't how to make the connection because is not the same. Because I didn't put this Jpanel in the category CardLayout because I won't to modify it later. So this connection:
private void ButtonGumbClick(java.awt.event.ActionEvent evt) {
CardLayout card = (CardLayout) DisplayPannel.getLayout();
card.show(DisplayPannel, "something");
}
Is not workingCan someone please help me to make a connection or something..
Thx


Sign In
Create Account


Back to top









