• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

commonPanel appear only in the last card with the CardLayout manager

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why the commonPanel appear only in the last card with the CardLayout manager?
How to make the commonPanel appear in all the cards with the CardLayout manager?

 
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it can only have one parent, so each time it is added to a new 'card', it is removed from the older card.

some options:
1) you can make commonPanel a class, then add a new instance of it to each card.
2) create a holding panel, cardlayout panel on top (or bottom), commonPanel in other area,
so only the 'cards' change
 
albert kao
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Dunn wrote:it can only have one parent, so each time it is added to a new 'card', it is removed from the older card.

some options:
1) you can make commonPanel a class, then add a new instance of it to each card.
2) create a holding panel, cardlayout panel on top (or bottom), commonPanel in other area,
so only the 'cards' change



Option 2:
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic