Hello everyone,

I am trying to write a player for a game, but... The GUI of the game is given, so only the logic of movement! I wrote my algorithms, but I am having problems to make them work with the GUI and the functions there...
The loadPlayer method looks like this:

private static Player loadPlayer(String s)
{
if(s.endsWith(".class"))
{
int i = s.indexOf('.');
s = s.substring(0, i);
}
Object obj;
Class class1 = (new FileClassLoader("player")).loadClass(s);
obj = class1.newInstance();
return (Player)obj;
Exception exception;
exception;
System.out.println("@ENGINE: Player " + s + " can't be loaded!");
return null;
}

The Contructor of th file, that I'm trying to load looks like this:

public Player (Moves gameBoard) {
currentBoard = gameBoard;
}

And it loads a method minimax (Moves board)

The Moves.class file's Contructor:

Moves () {
pieces = new byte [50];
clearBoard();
}

and the clearBoard method is:
public void clearBoard () {
int i;
whitePieces = 20;
blackPieces = 20;

currentPlayer = BLACK;

for (i = 0; i < 20; i++)
pieces [i] = BLACK;

for (i = 20; i < 30; i++)
pieces [i] = EMPTY;

for (i = 30; i < 50; i++)
pieces [i] = WHITE;
}

When I load the player, I recieve a couple of errors, which are:

Player PLAYER can't be loaded!
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at eMad.Gui.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unk nown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mou seReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)


If anyone can help with advice - please...

Greatings to all