I would suggest you to use Swing text field to open up when you click on jar, and after entering the path in the text field, give submit action which should take the data from text field and do your further logic.
so giving UI like this to enter path is actually good way..