package ColourGame; import java.awt.CardLayout; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.SwingUtilities; public class CardLayOut extends JFrame implements ActionListener{ CardLayOut card; Container c; CardLayOut(){ c=getContentPane(); c.add(button); c.add(MyPanel); c.add(MySecondPanel); } public void actionPerformed(ActionEvent e) { card.next(c); } public static void main(String[] args) { CardLayout cl=new CardLayout(); cl.setSize(400,400); cl.setVisible(true); cl.setDefaultCloseOperation(EXIT_ON_CLOSE); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)