I need some assistance using Eclipse on implementing a Jbutton task/code that opens up another applet when I click it, like how there are game launchers have the "Play Game" option to launch a game. Is this possible to do so?
My source code:
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
public class NiceGui {
        private JFrame frmSomegame;
        /**
         * Launch the application.
         */
        public static void main(String[] args) {
                EventQueue.invokeLater(new Runnable() {
                        public void run() {
                                try {
                                        NiceGui window = new NiceGui();
                                        window.frmSomegame.setVisible(true);
                                } catch (Exception e) {
                                        e.printStackTrace();
                                }
                        }
                });
        }
        /**
         * Create the application.
         */
        public NiceGui() {
                initialize();
        }
        /**
         * Initialize the contents of the frame.
         */
        private void initialize() {
                frmSomegame = new JFrame();
                frmSomegame.setTitle("SomeGame");
                frmSomegame.getContentPane().setBackground(Color.BLUE);
                frmSomegame.setBounds(100, 100, 450, 300);
                frmSomegame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frmSomegame.getContentPane().setLayout(null);
                JButton btnNewButton = new JButton("Play");
                btnNewButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent arg0) {
                                JOptionPane.showMessageDialog(null,"Hello!");
                        }
                });
                btnNewButton.setBounds(28, 41, 133, 50);
                frmSomegame.getContentPane().add(btnNewButton);
                JButton btnNewButton_1 = new JButton("Credit");
                btnNewButton_1.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent arg0) {
                                JOptionPane.showMessageDialog(null,"Created by Calvin");
                        }
                });
                btnNewButton_1.setBounds(25, 142, 136, 50);
                frmSomegame.getContentPane().add(btnNewButton_1);
                JButton btnNewButton_2 = new JButton("Quit");
                btnNewButton_2.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent arg0) {
                                int result = JOptionPane.showConfirmDialog(null,"Do you want to quit?","Are you sure?",JOptionPane.YES_NO_OPTION) ;
                                if(result == JOptionPane.YES_OPTION) {
                                        System.exit(0) ;
                                }
                        }
                });
                btnNewButton_2.setBounds(249, 142, 156, 50);
                frmSomegame.getContentPane().add(btnNewButton_2);
        }
}
 
    