How to launch jEdit from inside another Java program?
Submitted by Monday, 23 October, 2006 - 10:56
on
Sorry people this is probably a really dumb question but I've been searching the forum and the net for 2 hours and I can't find the answer.
I have a Java program that maintains a list of web pages. Presently the program is configurable to allow the user to select an editor of choice e.g. NotePad, WordPad, DreamWeaver etc. That editor is opened with the files that the user has selected from a list box. I would like it to be possible for jEdit to be used, however I have failed completely to get jEdit to launch. I have found numerous examples of code on the web that make a call like this -> jEdit.openFile(null, path) but when I use null for the View I get a null pointer exception. I've tried using jEdit.getCurrentView and that returns null (not surprisingly), I've even launched jEdit manually and getCurrentView still returns a null.
What am I missing, I assume this is possible? I don't want multiple instances, I just want a single instance of jEdit running with the ability to set it viewing one or more files that have been selected from inside of my Java program.
Any help most appreciated. I'm running jEdit 4.3pre7 under Windows XP Home.
I have a Java program that maintains a list of web pages. Presently the program is configurable to allow the user to select an editor of choice e.g. NotePad, WordPad, DreamWeaver etc. That editor is opened with the files that the user has selected from a list box. I would like it to be possible for jEdit to be used, however I have failed completely to get jEdit to launch. I have found numerous examples of code on the web that make a call like this -> jEdit.openFile(null, path) but when I use null for the View I get a null pointer exception. I've tried using jEdit.getCurrentView and that returns null (not surprisingly), I've even launched jEdit manually and getCurrentView still returns a null.
What am I missing, I assume this is possible? I don't want multiple instances, I just want a single instance of jEdit running with the ability to set it viewing one or more files that have been selected from inside of my Java program.
Any help most appreciated. I'm running jEdit 4.3pre7 under Windows XP Home.