Ive gone through some stack overflow questions and found this similar question. From what I understand using a switch statement in an actionPerformed method for this context will not work and an if-else statement is required. Is there a more efficient way to do this without having repetitive code? I’ve heard I could use Abstract Action to give multiple buttons
Tag: cardlayout
JTextField doesn’t appear after switching panel using CardLayout
i have 4 panels associated to a content panel which uses a card layout. If i try to switch between the cards by using the buttons, i can see the JLabels but no JTextFields. I assume they are there because there is space between the JLabels, so i tried to revalidate and repaint the panels after switching to them but