As the title states im having trouble with a method inside a mousehandler. My mousehandler is:
public class MouseHandler implements MouseListener{
@Override
public void mouseClicked(MouseEvent e){
}
@Override
public void mousePressed(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
try {
Pieces.getPos(e, coordinateXYZV, tile,chessBoard);
}catch (Exception a){
}
}
}
now i know questions about static stuff are really not welcome, but i just cant seem to find the solution although similar problems were easily fixed. Neither the class with the mousehandler nor the method is static, so why am i getting this error in the first place? Im creating a new mousehandler like this:
MouseHandler mhandler = new MouseHandler();
and then pass it around to whereever its needed. if anything further is needed please point it out because this is my first time asking a question here and im not entirely sure whats needed to help me here
For future people stumbling upon this: call your methods correclty: