I can usually open a .docx file in Word using desktop.open
fault of java, but there is a case where I need to open the document that is password protected and Word opens asking for the same. Is there any way I can enter the password still in the program and when opening the document it will open without asking?
Part of the code I'm using:
public void actionPerformed(ActionEvent e) {
try {
Desktop desktop = Desktop.getDesktop();
File file = new File("" + caminhofonte1global.getSelectedFile());
desktop.open(file);
}
catch (IOException ioe) {
ioe.printStackTrace();
}
}