That is weird, as the code shows it defaults to monitor to the first interface it finds, but it continues searching and will actually monitor the last interface it finds that is activated! Perhaps as the applet gets loaded the wlan0 is not active yet.