I am using Jazzy API and english.0 file in my application. I get the dictionary file as a resource using,
private static createDictionary()
Application instance = new Application();
java.net.URI engUri = instance.getClass().getResource("/dict/english.0").toURI();
File englishDictFile = new File(engUri);
SpellDictionary engDictionary = new SpellDictionaryHashMap(englishDictFile);
JTextComponentSpellChecker spellCheckerComp = new JTextComponentSpellChecker(engDictionary, "Spell Check");
This workd fine on my desktop. When I create the jar file I include the dict folder which contains the dict file. I implement the application in Java Web Start using JNLP file. When I run the jnlp file, it throws,
NullPointerException, URI is not hierarchical.
Can sombody tell me why it is.
If I want to specify the dict file as a resource in my jnlp file, how do I do that. Thank you.
Instead of getResourceAsURI, use
InputStream in = instance.getClass().getResourceAsStream(dictFile);
create the Dictionary with
new SpellDictionaryHashMap(new InputStreamReader(in));
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.