I'm teaching myself Java and I'm using the Deitel book as it came highly recommended and I've hit a bit of a snafu.
So I tried copying over the figure 27.5-8 in the book Java: How to Program. I figured I would need the .5 figure as it's the server and the .7 figure because it's the client. So I made them both in the same project and then combined their main classes (figures .6 and .8) so they when I ran the program it would boot up both the server and the client. But when I tell netBeans to compile and run it opens the windows I have set up for the server and the client but the textFields won't enable (as they're supposed to when they receive a connection.) and as far as I can tell they aren't connecting to each other.
The server.java and client.java files should be exactly the same as they were in the book, so I figure I must have messed up when I blended the main files to boot them both up. Here is my combined main file. Maybe I did something wrong here?
package server_client;
import javax.swing.JFrame;
public class Main {
public static void main(String[] args) {
Server application = new Server(); //create server
Client applicationClient; //declare client application
//if no command line args
if (args.length==0)
applicationClient = new Client ("127.0.0.1"); //connect to localhost
else
applicationClient = new Client (args[0]); //use args to connect
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
applicationClient.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
application.runServer(); //run server application
applicationClient.runClient(); //run client application
}//end main
}//end class Main