i have a button im my swing application where i want it to open a text file in wordpad when it is clicked. so far i have:
if(e.getSource() == pktLogButton)
{
try{
String s = "PktLog.txt";
Process p = Runtime.getRuntime().exec("wordpad.exe " + s);
}
catch(IOException e2){
e2.printStackTrace();
}
}
for some reason i get an error. but it works if i use
Process p = Runtime.getRuntime().exec("notepad.exe " + s);
but i don't want to open it in notepad because it doesn't show any special characters. so how can i get wordpad to open the text file? any help is much appreciated.