In the following example I am trying to make sure if a clicked button is included inside a certain JButton array. When pressing the button in the screen I just getting the string false which means the while loop evaluates to false.
I think if I am not wrong that this is because Arrays.asList(ArrName).contains(element)
doesent apply to primitive types.
If my guess is true how to solve this issue? If it is not true what is the solution for this ?
JButton[] num;
c = ((JButton) e.getSource()).getText();
System.out.println(Arrays.asList(this.num).contains(c));
while(Arrays.asList(this.num).contains(c)){
System.out.println("True");
}