I have created a JAVA application to get the IMDB ratings of movies. The application takes one command line argument (name of the movie) and displays the rating of the same. I have added the application to the right-click context menu. so, now when I right click I need the file name (without extension) to be passed as a command line argument. How can I do this?
I tried adding %1
as placeholder in the registry but it doesn't seem to work. The application works from the command line with an argument.
Can someone help me?
COMMAND LINE:
java -jar C:\NetBeansProjects\APPLICATION\dist\APPLICATION.jar daredevil
OUTPUT:
ERROR
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at application.IMDB.IMDBFetch(IMDB.java:67)
at application.IMDB.URLParse(IMDB.java:54)
at application.IMDB$4.run(IMDB.java:387)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$300(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
REGISTRY ENTRY
java -jar "C:\NetBeansProjects\APPLICATION\dist\APPLICATION.jar" "%1"