Please dont flame me and say its an easyer way to do it.
I'm just adding what i use to add.
To start off, make a new file you call test.java and add this in it:
Inside there, add this:
Code:
public class [Filename] {
so in this example we use this:
Code:
public class test {
after that, add this:
Code:
public void testvoid(client c) {
The client c means you load variables from client.class (client.java).
inside there you can start.
Code:
c.sendMessage("test, test");
}
you see? use the c. before the variable which is in your client.class.
after that you should end your public class.
Its just to add a bracket.
Now your file would look like this:
Code:
public class test {
public void testvoid(client c) {
c.sendMessage("test, test");
}
}
That was the .java file.
Now go to server.java.
Find this code:
Code:
(new Thread(clientHandler)).start();
add this under it:
its like this: [filename] = new [filename]();
find the process stuffs or just search for playerHandler.process();
do the same there. [filename].process();
so in this example we use this: test.process();
scroll down to your statics, or just search for this:
public static PlayerHandler playerHandler = null;
add the same.. public static [filename] [filename] = null;
so in this example we use this: public static test test = null;
now save and close server.java.
open up client.java.
At your action, f.example a command, add this.
Code:
server.test.testvoid(this);
so thats like this. server.[filename].[variable in filename](this);
As command, you could add this.
Code:
if(command.equalsIgnoreCase("blablabla")) {
server.test.testvoid(this);
}
if the method in the test.java were like this: public void testvoid(int test, client c)
Then, in your client.java, you should edit server.test.testvoid(this); to server.test.testvoid(test, this);
So if you add anything inside (), then do the same with the server.test.testvoid(this); too..
Just dont add like this: server.test.testvoid(client c, test)
You dont need client c, cause its not a variable.
Hope this helps someone 
- Izzane