nus-cs2103-AY2021S2 / forum

10 stars 0 forks source link

Intellij running window off screen #280

Closed xuanqi966 closed 3 years ago

xuanqi966 commented 3 years ago

Hi, I'm encountering an issue with the position of the app window. When I run the app by running Main in Intellij, the app is running and the app icon appears on the task bar (circled in red in the image below), but the app window is no where to be found. I've tried deleting the .ideas files or resetting workspace.xml but none of these worked. My teammates are still able to run the app as usual so I suspect there's something wrong with my Intellij. My Intellij version is 2020.3.3 Ultimate. Screenshot 2021-04-01 164652

damithc commented 3 years ago

Try after running gradlew clean to get rid of any output files created earlier.

xuanqi966 commented 3 years ago

Try after running gradlew clean to get rid of any output files created earlier.

Hi prof, I tried but still doesn't work.

damithc commented 3 years ago

Hi prof, I tried but still doesn't work.

Try deleting the out folder manually. BTW, what happens if generate a JAR file and run that instead? Does the Window show up?

xuanqi966 commented 3 years ago

Hi prof, I tried but still doesn't work.

Try deleting the out folder manually. BTW, what happens if generate a JAR file and run that instead? Does the Window show up?

Deleting the out folder doesn't work as well. Running the JAR directly is okay, the window shows up properly.

damithc commented 3 years ago

Delete the preferences.json file at the root of the project folder and see if that works.

xuanqi966 commented 3 years ago

Delete the preferences.json file at the root of the project folder and see if that works.

It worked after deleting preferences.json, thank you prof!

damithc commented 3 years ago

Explanation: AB3 'remembers' its last Window position/size, which is stored in preferences.json file. I suspected the data in that file is corrupted and deleting it might solve the problem. But I thought the file is stored either in the build folder or out folder but as neither worked, I dug around in my AB3 code a bit more to find where exactly is that file, which turned out to be in the project root.