Me and my team are trying to use reflection to implement the listeners for the buttons in this simple calculator. We are doing this for an engineering class. We added a break point at line 35 "Class aListenerClass = Class.forName(splitString[0]);" because it keeps throwing a ClassNotFound exception, and it's being thrown after we split the
string to identify the right listener. The "Controller" you see there, well, we are implementing the Application Controller
pattern for the back-end of this calculator...
Why in the world is it throwing ClassNotFound?
When we run this on debug mode in eclipse, we can check the value of the split elements, right? Well... it shows "CalculateListener" for the first element of the split string, yet when we expand the element it lists [C,a,l,c,u,l,a,t,e,L,i,s,t,e,n,e,r,_,e,q,u,a,l,s] as it's value--as if the string never got split, but it is being split! Check our code below. I'm also including the R file, so you guys can check all the ids and see how we are implementing reflection here. Please give us some light We would be eternally grateful!
In advance, thank you so much!
Sincerely,
Ben, Diego (0x783czar), Trevor, David, and Steve.