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();
}
}