Hello! This is my first post, I'm new to java and I found when I search for things this site often shows itself on google results so why not join? Anyways I'm creating a text editor in java and I want to find out how to in for example windows explorer you can right click --> Open with --> (program / browse for one). I want that ability, i mean you can obviously do that but it won't open the file. Anyone have any idea? Thanks for any help!

Edited by NardCake: better title

5 Years
Discussion Span
Last Post by JamesCherrill

Which GUI are you working with? if its default swing, then you need JFileChooser to do that. Also you will need to know about actions that activates the right clicking.

Put something there and we will assist you. We dont give codes here. We are not free code factory. We only assist.


Nor sure exactly what you are asking here... is this about writing your Java program, or how to configure Windows shell to add items to the right-click explorer context menu?
For the Java side - you can accept the file name into your program as a string parameter on your main method. Then you can configure the menu to invoke your program with the file names as a parameter.


The question is about getting what file the user selected to open my program with to open.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.