944,162 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2475
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
May 24th, 2006
0

Can JMenuItem point to a HTML file that opens in IE?

Expand Post »
Can JMenuItem point to a HTML file that opens in IE?

I want the jMenuItem (E.g: Tutorial Help) to point to tutorial.html on my computer.

Couldn't find any information about it at all on the net. Can any kind souls out there help me?

Your help is greatly appreciated.

Thank you.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
blurstudent is offline Offline
14 posts
since May 2006
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

Quote originally posted by blurstudent ...
Can JMenuItem point to a HTML file that opens in IE?

I want the jMenuItem (E.g: Tutorial Help) to point to tutorial.html on my computer.

Couldn't find any information about it at all on the net. Can any kind souls out there help me?

Your help is greatly appreciated.

Thank you.
You mean, how can you open up a url from a java program?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

erm. ya. sort off. But mine is an application. I just want the link to point to a HTML file. Can it be done?

Pardon me if it can't be done.

Thanks!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
blurstudent is offline Offline
14 posts
since May 2006
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

Quote originally posted by blurstudent ...
erm. ya. sort off. But mine is an application. I just want the link to point to a HTML file. Can it be done?

Pardon me if it can't be done.

Thanks!
Oh i see, you mean like how can java execute an external process, such as notepad, or in your case a .html file?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

yeah. I just want it to open in Internet Explorer in this case. You able to help me?

I'll be very much appreciated.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
blurstudent is offline Offline
14 posts
since May 2006
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

Java Syntax (Toggle Plain Text)
  1. /*
  2.   * ped.java
  3.   *
  4.   * Created on 29 April 2006, 17:07
  5.   */
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.util.*;
  9.  
  10.  
  11. public class ped {
  12. public static void main(String[] args) throws Exception {
  13. try
  14. {
  15. Runtime rt = Runtime.getRuntime();
  16. Process p = rt.exec("notepad.exe");
  17. }
  18.  
  19. catch(Exception e)
  20. {
  21.  
  22. }
  23. }
  24. }

That opens notepad, although I'm not sure how to open explorer? But I reckon it's pretty close...
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

hey, thanks for that part! I managed to open up the IE. But the problem here is, I do not know how to get it to point to the URL "tutorial.html"

Sorry about that.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
blurstudent is offline Offline
14 posts
since May 2006
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

Oopsie, I gotta go now.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

hey! No worries! I got it settled!

Runtime rt = Runtime.getRuntime();
Process p = rt.exec("C:/Program Files/Internet Explorer/iexplore.exe www.yahoo.com.sg");

and it works! wohoo!

Thanks alot!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
blurstudent is offline Offline
14 posts
since May 2006
May 24th, 2006
0

Re: Can JMenuItem point to a HTML file that opens in IE?

But why do it like that?
Why not embed a web browser control in a Java window?
If simple HTML 3.0 is enough you can use standard controls for that, else you might have to find something on the web (or get creative and write your own HTML parser).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Restricting Shut Down
Next Thread in Java Forum Timeline: NetBean 5.0 Mobility





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC