Now, in your case there are a few things you should change:
public void updateCamera(){
a = MouseInfo.getPointerInfo();
b = a.getLocation();
mX = (int)b.getX();
mY = (int)b.getY();
cX = (mX - xPos) * dist + xPos;
cY = (mY - yPos) * dist + yPos;
float dirX = (cX - lX);
float dirY = (cY - lY);
float length = (float)Math.sqrt(dirX * dirX + dirY * dirY) - 0.6f;
float outX = lX;
float outY = lY;
if(length > minDist) {
dirX /= length;
dirY /= length;
dirX *= delta + 0.5f;
dirY *= delta + 0.5f;
outX = lX + dirX;
outY = lY + dirY;
}
x = (int)outX;
y = (int)outY;
}
Also, before you ask: I have taken a look at your code and haven't found the camera being used anywhere. So I thought you were having problems with that as well. Here is a solution: You can add an x and y offset to the position of every thing that is rendered, like entities and the player, but not the UI. And in each update you set that x and y offset to the negative x and y position of the camera. In that way the world will move around, creating the feeling that there is a camera.