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 click on the buttons? Below is the code for my CardLayout class. Suggestions are also welcome if some part of the code are bad practise. Thanks! import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class CardLayoutTest extends JFrame implements ActionListener { // Ref private JPanel