URGENTE Abrir archivo .HLP desde Java
Hola tengo hecha una ayuda con formato .HLP y necesito saber cómo puedo abrirla desde el programa Java al pulsar un botón.
Muchas gracias.
Muchas gracias.
He probado este código, compila bien pero al dar a la opción de mi progrma "ayuda" me dice que no puede abrir el archivo de ayuda. ¿Alguien me puede ayudar por favor?
public void Acerca_de_actionPerformed(ActionEvent e) {
String cmd = "./Ayuda Biblioteca/AYUDA.HLP";
try {
Runtime r = Runtime.getRuntime();
Process proc = r.exec("winhelp.exe" + cmd);
proc.waitFor();
}
catch (Exception exc) {
JOptionPane.showMessageDialog(this, exc.getMessage(),
"Ayuda", JOptionPane.INFORMATION_MESSAGE);
}
}
Muchas gracias.
public void Acerca_de_actionPerformed(ActionEvent e) {
String cmd = "./Ayuda Biblioteca/AYUDA.HLP";
try {
Runtime r = Runtime.getRuntime();
Process proc = r.exec("winhelp.exe" + cmd);
proc.waitFor();
}
catch (Exception exc) {
JOptionPane.showMessageDialog(this, exc.getMessage(),
"Ayuda", JOptionPane.INFORMATION_MESSAGE);
}
}
Muchas gracias.
ese codigo tal ves te sirva pero es algo antiguo
ayuda.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
try{
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = {"C:/WINDOWS/winhlp32.exe","c:/Archivos de programa/Ayuda tuayuda.hlp"};
Process child = rt.exec(callAndArgs);
}catch(Exception eee){System.out.println("hubo error");}
}
});
ayuda.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
try{
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = {"C:/WINDOWS/winhlp32.exe","c:/Archivos de programa/Ayuda tuayuda.hlp"};
Process child = rt.exec(callAndArgs);
}catch(Exception eee){System.out.println("hubo error");}
}
});