Zeeshan Syed
01/10/2023, 4:43 PMopenFileDialog()
function. It simply opens a picker and gives back selected files to the lambda param. And the 2nd snippet is where I'm calling the openFileDialog() function in a button onClick listener.
Now the issue is, after the file picker is opened, when I double click on an image, the function returns a list of files properly but then the picker shows up again automatically. It doesn't open if I single tap on image and then click on "open" button in chooser.
When I try to debug by printing logs, I got to know that the Button is invoking onClick if I do a double tap in chooser. The 2nd tap in Double tap is treated as a click on the "Pick a file" button.
One more thing to note is, If i move the chooser window aside of my App's window, then the issue doesn't happen.
I mean, the mouse pointer has to be in the chooser and the behind the chooser where the pointer is, the App's windows needs to be there. Basically, you can replicate it easily by maximising the app window and then open the chooser. Then the said condition will be valid.
I used rt-4.0.0.jar which has the FileDialog class located at Java.awt.FileDialog