added hints

if ((Math.abs(deltaL%(1)) < 0.01)&&(Math.abs(phase%(2*pi)) < 0.1)||(Math.abs((deltaL-0.5)%1) < 0.01)&&(Math.abs((phase-pi)%(2*pi)) < 0.1)){
  text = " Constructive Inference ";
  texthint1correctbackground = java.awt.Color.YELLOW;
  hintshow = true;
}
//P.D. = 0.5lambda, phi =0 || P.D. = 0, phi =pi
//else if (Math.abs((deltaL-0.5)%1) < 0.01)&&(Math.abs(phase%(2*pi)) < 0.1)||Math.abs(deltaL%(1)) < 0.01)&&(Math.abs((phase-pi)%(2*pi)) < 0.1)){
else if ((Math.abs((deltaL-0.5)%1) < 0.01)&&(Math.abs(phase%(2*pi)) < 0.1)||((Math.abs(deltaL%(1)) < 0.01)&&(Math.abs((phase-pi)%(2*pi)) < 0.1))) {
text = " Destructive Inference ";
  hintshow = true;
  texthint2correctbackground = java.awt.Color.YELLOW;
  }
  else {
  text = "";
    hintshow = false;
    texthint1correctbackground = new java.awt.Color(255,255,255,255);;
    texthint2correctbackground = new java.awt.Color(255,255,255,255);;
  }


added hinttext

if (hint==true&&(Math.abs(phase%(2*pi)) < 0.1)){
texthint = "When the sources are in phase, math_failure (math_unknown_error): \\phi =0";
texthint1 = "condition for constructive interference: |S1P-S2P| = m math_failure (math_unknown_error): \\lambda , where m = 0, 1, 2, ...";
texthint2 = "condition for destructive interference: |S1P-S2P| = (m + 0.5) math_failure (math_unknown_error): \\lambda , where m = 0, 1, 2, ...";

}
else if (hint==true&&(Math.abs((phase-pi)%(2*pi)) < 0.1)){
texthint = "When the sources are in anti-phase, math_failure (math_unknown_error): \\phi =180 degree";
texthint1 = "condition for constructive interference: |S1P-S2P| = (m + 0.5) math_failure (math_unknown_error): \\lambda , where m = 0, 1, 2, ...";
texthint2 = "condition for destructive interference: |S1P-S2P| = m  math_failure (math_unknown_error): \\lambda , where m = 0, 1, 2, ...";
}
else {
texthint = "move the source phase math_failure (math_unknown_error): \\phi into in phase math_failure (math_unknown_error): \\phi =0 or anti-phase math_failure (math_unknown_error): \\phi =180 degree for hints regarding them";
texthint1 = "";
texthint2 = "";
}