This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Open Help(.chm) File on click on Button  RSS feed

 
Nitin Agarwal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to open Help file .chm on click of JButton. I am using following code on button click
but it is giving
error: CreateProcess: keywording.chm error=193


Runtime run = Runtime.getRuntime();
try
{
Process child = Runtime.getRuntime().exec("keywording.chm");
}
catch (Exception ex)
{
ex.printStackTrace();
System.out.println(ex.getMessage());
}



please tell me solution or any other easy way to do it.

Thanks,
Nitin
 
Yari Podio
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nitin Agarwal:
Hi,

I want to open Help file .chm on click of JButton. I am using following code on button click
but it is giving
error: CreateProcess: keywording.chm error=193


Runtime run = Runtime.getRuntime();
try
{
Process child = Runtime.getRuntime().exec("keywording.chm");
}
catch (Exception ex)
{
ex.printStackTrace();
System.out.println(ex.getMessage());
}



please tell me solution or any other easy way to do it.

Thanks,
Nitin


Hmmm....

three questions:

1) Which is the OS and the JVM version?
2) if you put directly the file name in a cmd window what happens?
3) Have you tried to put the full path (enclosed by quotes) when calling the system? for example:

Runtime.getRuntime().exec("\"c:\\somedir\\keywording.chm\"");
 
Nitin Agarwal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1. OS is Win 2003 Server and JVM version is 1.4.
2.When i put file name in cmd then it opens that help file.
3.Yes i tried full path of file but still it is giving same error.

Please try to solve it.

Thanks
Nitin
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler keywording.chm");
 
Nitin Agarwal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael Dunn ,


Thanks u Very much. My problem is solved now. But could u please tell me is this .chm will also run on Macintosh or there is any other format. Actually this application i am developing for Macintosh on Windows 2003 Server.

Nitin
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> this .chm will also run on Macintosh

I have not done anything with Macintosh, so I can't help with that question.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!