Questions tagged [cardlayout]

A CardLayout is a graphical layout manager for a container. It treats each component in the container as a card. Only one card is visible at a time, and the container acts as a stack of cards.

A CardLayout is a graphical layout manager for a Container. It treats each component in the container as a card. Only one card is visible at a time, and the container acts as a stack of cards.

For Java Swing, see How to Use CardLayout.

562 questions
47
votes
14 answers

How do I change JPanel inside a JFrame on the fly?

To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action. So, what's the correct way of doing such a thing?…
yanchenko
  • 56,576
  • 33
  • 147
  • 165
25
votes
1 answer

How to use CardLayout with Netbeans GUI Builder

Preface (this is a self-answer post) I've gotten my feet wet with Netbeans GUI Builder but I am just not starting to dive in to it to learn the more intricate details. I really didn't even know hot to change layout manager from the design view, I…
Paul Samsotha
  • 205,037
  • 37
  • 486
  • 720
22
votes
6 answers

Card View Click on Card Move To New Activity

I am new to Android programming and was working on a card layout. I was wondering, how do I make it clickable? android:clickable="true" android:foreground="?android:attr/selectableItemBackground" I have that on my card widget and then I wanted to…
NexusOnly
  • 223
  • 1
  • 2
  • 4
19
votes
5 answers

Appcompat CardView and Picasso no rounded Corners

I do not know where Exactly i Should Adress this issue, if it is my fault, there is something in the Picasso Lib Wrong or in the Cardview Library. Basicly i have a CardView containing an image (Full Card Covered) and A TextView overlaying. When…
Angelo
  • 1,711
  • 2
  • 12
  • 11
19
votes
1 answer

Changing Panels using the Card layout

Hi Im sorry if this has already been posted but I looked hard and found other codes that I could not understand very well. I am new to java programming and would like someone to point me in the right direction on how I could change to desired panels…
user1906515
15
votes
2 answers

What's so special about CardLayout vs manual adding/removal of JPanels?

There have been many times on StackOverflow where a user asks a question like this... I have a main JPanel that contains a child JPanel. When the user clicks a button, the child JPanel should change to a different JPanel. How can I achieve…
wattostudios
  • 8,666
  • 13
  • 43
  • 57
13
votes
4 answers

How to get the top card in Java's CardLayout

Is it possible to get the top card in Java's CardLayout? I've tried looping through each component to check for visibility with isVisible() but it seems that they're all "visible". Edit: By "top card" I mean the one that's currently at the "top",…
alexcoco
  • 6,657
  • 6
  • 27
  • 39
11
votes
1 answer

How to change card layout panels from another panel?

I Googled for a lot, and no solutions found. I think there shall be java masters to help me out ... This is my initialize method: private void initialize() { this.setSize(750, 480); this.setContentPane(getJContentPane()); …
Shuyi
  • 906
  • 2
  • 13
  • 28
8
votes
2 answers

CardLayout get the selected card's name

How can I get the string identifier of the selected panel in card layout.
wotan2009
  • 151
  • 1
  • 3
  • 6
8
votes
2 answers

CardView for android not importing

I got the jar file of Card View from sdk\extras\android\m2repository\com\android\support\cardview-v7\21.0.0-rc1 and I tried the example from this link1 and link2 I was able to do for Recycler but for card view it is shwoing the error in xml for…
Kartheek Sarabu
  • 3,886
  • 8
  • 33
  • 66
8
votes
1 answer

How to reload a JPanel?

I'm a java newbie... I need to know how to reload a JPanel? I extended the JPanel class and created a panel that will run in a cardlayout in an Applet. I want this panel to reload/refresh after the user clicks a button in this panel. I tried…
JLA
  • 329
  • 1
  • 6
  • 12
7
votes
4 answers

How to set a JFrame size to fit the CardLayout displayed JPanel?

I have a JFrame containing a set of JPanels in a CardLayout. Each JPanel has a different size and I want the JFrame to adapt to the size of the currently displayed JPanel (not the JPanel to adapt to the size of the JFrame). How can I achieve this?
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
7
votes
2 answers

How to show different cards in a CardLayout?

I looked at a code example that used this code: cl.show(cardPanel, "" + (currentCard)); But when I use show I get a message in Eclipse that it's deprecated and I wonder if there is another way to show the different cards in the CardLayout when I…
3D-kreativ
  • 9,053
  • 37
  • 102
  • 159
6
votes
1 answer

how to change UI depending on combo box selection

In dialog I need to display one group of controls if some combo is checked and another group of controls otherwise. I.e. I need 2 layers and I need to switch between them when combo is checked/unchecked. How can I do that? Thanks
Oleg Vazhnev
  • 23,239
  • 54
  • 171
  • 305
6
votes
1 answer

How do I work with the Card Layout in the NetBeans GUI builder?

Does anyone know how to work with the Card Layout in the NetBeans GUI builder tool? I want to show panels as per the JRadioButton selection, so I want to lay this out using the Card Layout.
Sidharth
  • 3,629
  • 7
  • 26
  • 22
1
2 3
37 38