Resolved by using Control + Click instead of Right Click, as there was no solution that I was looking for.
private void j1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
buttonAction(evt, 1);
if (evt.getModifiers() == 18){
System.out.println("Control click pressed!")
}
}