We will need a ".java" file for these steps. If you don't have one handy, you can simply open a file browser, and go to a scratch/play directory and create an empty "Foo.java" file...
NOTE WELL -- For these steps we'll assume you are using "Foo.java", but it could be any ".java" file.
Steps:
Open a file browser to location of Foo.java
Select Foo.java
Right-Click
Pick "Open With"
Pick "Choose another app"
At bottom choose "More Apps" then at bottom choose "Look for another app on this PC"
Navigate to your editor installation directory (e.g. something like "C:\Program Files\Notepad++\" if choosing "Notepad++")
Select your editor's executable file (e.g. something like "notepad++.exe" if choosing "Notepad++")
Click "Open"
Now try double-clicking on Foo.java to make sure the editor opens.
Also see tips in "References" below (including for MAC)