Your method clickToScan also takes a parameter scanner and uses that instead of the scanner that is scoped to your class. If you want to use the "unused" one you can specify by writing this.scanner.startScan().
clickToScan
scanner
this.scanner.startScan()