Jump to content

CardLayout problem / Netbenas

- - - - -

  • Please log in to reply
No replies to this topic

#1
Serialcek

Serialcek

    Learning Programmer

  • Members
  • PipPipPip
  • 72 posts
Hello everyone.
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 working

Can someone please help me to make a connection or something..
Thx




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users