In that rar file below is my sketch ouput that i want to make. my question is, how to create/connect to a new windows/frame after pressing button next? this is my unfinish coding for first frame, what should i add for btnNext method?
import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; public class GoKart extends JFrame implements ActionListener { private JLabel lblName, lblIC, lblGen, lblPn, lblMail; private JTextField txtName, txtIC, txtGen, txtPn, txtMail; private JButton btnReset, btnNext; private JPanel pnlA, pnlB, pnlPersonalDetails; private Container cont; private GridLayout layout; public GoKart() { //set the title super ("Go-Kart Booking Online Form"); layout = new GridLayout(6, 2); cont = getContentPane(); cont.setLayout(layout); //set label lblName = new JLabel ("Name: "); lblIC = new JLabel ("IC: "); lblMail = new JLabel ("Email: "); lblGen = new JLabel ("Gender: "); lblPn = new JLabel ("Phone Number: "); //set textfield txtName = new JTextField(10); txtIC = new JTextField(10); txtMail = new JTextField(10); txtPn = new JTextField(10); //set button btnReset = new JButton("Reset"); btnNext = new JButton("Next"); //set panel pnlA = new JPanel(); pnlA.setLayout(new GridLayout(5, 2)); pnlB = new JPanel(); pnlB.setLayout(new GridLayout(1,2)); pnlPersonalDetails = new JPanel(); pnlPersonalDetails.setLayout(new GridLayout(1,0)); pnlPersonalDetials.setBorder(new TitledBorder(new EtchedBorder(),"Personal Details")); //add to JPanel pnlA.add(lblName); pnlA.add(txtName); pnlA.add(lblIC); pnlA.add(txtIC); pnlA.add(lblGen); pnlA.add(txtGen); pnlA.add(lblPn); pnlA.add(txtPn); pnlA.add(lblMail); pnlA.add(txtMail); pnlB.add(btnReset); pnlB.add(btnNext); pnlPersonalDetails.add(pnlA); //register listener btnReset.addActionListener (this); btnNext.addActionListener (this); //add to Container cont.add(pnlPersonalDetails, BorderLayout.NORTH); cont.add(pnlB, BorderLayout.SOUTH); setSize (500, 250); setVisible (true); setDefaultCloseOperation (EXIT_ON_CLOSE); } public void actionPerformed (ActionEvent e) { if(e.getSource() = btnReset) { txtName.setText(""); txtIC.setText(""); txtGen.setText(""); txtPn.setText(""); txtMail.setText(""); } else if(e.getSource() = btnNext) {