-2

Currently I am developing a system using Java. I want to open files (doc, pdf, etc.) by clicking on a jTable row. Unfortunately, I get this error from RunDLL:

Error in url.dll
Missing Entry:
FileProtocolHandlerC:UsersH.M.ThaheedDocumentsNew2

Here is my code:

 private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {                                     
     int row = jTable1.getSelectedRow();
     String value = (jTable1.getModel().getValueAt(row, 2).toString());
     try {
         //  Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler" + value);
        Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler"+
                value);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
pushkin
  • 9,575
  • 15
  • 51
  • 95
  • 4
    Images of text are unacceptable. Copy/Paste the entire stack trace into your post, formatted as `code` – Jim Garrison Jun 18 '18 at 17:44
  • what's the value of ``value``? – f1sh Jun 18 '18 at 17:45
  • Above image shows the error. Please improve the codes. – nasik hameed Jun 18 '18 at 17:50
  • 1
    StackOverflow is not a code writing service. People are volunteering their time to answer your questions. You can't just order people to fix your code and expect anyone to spend their limited time trying to help you. – divibisan Jun 18 '18 at 18:07
  • See also https://stackoverflow.com/questions/13047158/rundll32-url-dll-fileprotocolhandler – lexicore Jun 18 '18 at 18:38
  • 1
    @divibisan I don't see how this question is impolite or how the OP orders anything. OK, the working might have been better but it is not impolite and quite clear about the problem. – lexicore Jun 18 '18 at 18:43
  • @JimGarrison There's obviously no stack trace as the problem does not come from Java. – lexicore Jun 18 '18 at 18:44
  • @lexicore I'm referring to the comment where, after being asked to put the error into the text of the question, the OP refuses and says "Please improve the codes". I'll admit it could be completely unintentional due to a language barrier, but at the very least it reflects a refusal to work with the answerers to help them solve their problem. I agree it isn't a bad question and I didn't down-vote it, but that reply to someone trying to improve the question rubbed me the wrong way. – divibisan Jun 18 '18 at 19:30
  • Sorry for inconvenience if i'm order someone to do my work. I am also considering others valuable time period. I am a developing programmer.I can do much better for my work. During my work this error has been occurred. Please help me to solve this. – nasik hameed Jun 19 '18 at 05:42
  • If i am saving any path it saved incorrectly like this in mysql database (E:Nifras1.pdf).. There is no slashes (/). That's why it didn't open any file. Could someone help me – nasik hameed Jun 19 '18 at 18:14

1 Answers1

0

You problem is most probably in the way you provide the path to your target file.

One thing is it looks like you need a space after FileProtocolHandler.

Another is that your slashes seem to go missing. Please see the question I've linked to for more pointers.

lexicore
  • 42,748
  • 17
  • 132
  • 221