I have a java menubar in my program that just has 1 option with 2 sub-options, e.g. File -> Save, Close. But instead of Save and Close, my options are Server and Client. So for the action event for the 1st option I have this java action listener:
public class serverAction extends AbstractAction
    {
        public serverAction()
        {
            super();
        }
        public void actionPerformed(ActionEvent e)
        {
            JOptionPane.showMessageDialog(null, "Test");
        }
    }
So this works when I click on File->Server, it pops up a window that says Test. Now I have a server class (That I have tested separately and know it works) that looks like this:
public class SocketServer {
    public static void main(String[] args) throws Exception {
        ...
    }   
    private static class ClientListenThread extends Thread {        
        public ClientListenThread(Socket socket, int ClientNumber){
            ...
        }       
        public void run() {
            ...
        }
    }
    private static class ServerSendThread extends Thread {      
        public ServerSendThread(Socket socket) {
            ...
        }       
        public void run() {
            ...
        }
    }
}
Now I need to call this SocketServer class when I click on the server option of my main program so that it can start the server code and wait and listen for any client connections. My question is, how do I start the entire SocketServer class code from the serverAction class?
 
     
    