|
-
Jul 7th, 2005, 08:08 PM
#1
Thread Starter
Frenzied Member
hyperlink to page[Resolved]
Could someone please tell me how to hyperlink to a page? Say if I had a combobox and the user selected an item, how could I hyperlink to a page?
Last edited by System_Error; Jul 8th, 2005 at 04:06 PM.
-
Jul 7th, 2005, 10:40 PM
#2
Dazed Member
Re: hyperlink to page
I guess just store the Strings within the JComboBox in URL format. Then when an ActionEvent is fired off from clicking on one get the value, create a new URL and go from there.
-
Jul 8th, 2005, 07:18 AM
#3
Thread Starter
Frenzied Member
Re: hyperlink to page
But how do you actually open a page when you have the URL object?
-
Jul 8th, 2005, 09:39 AM
#4
Re: hyperlink to page
Well, if you have an embedded browser, you can give it the URL. But you probably want to open it externally, right?
That's a rather troublesome problem, because Java has no native support for that. What you basically need is a JNI component that figures out the user's default browser in a platform-specific way, then use System.exec to call that browser, passing the URL as a parameter.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 8th, 2005, 10:11 AM
#5
Dazed Member
Re: hyperlink to page
Too bad he couldn't just integrate a brower into his app using a JEditorPane.
-
Jul 8th, 2005, 03:33 PM
#6
Re: hyperlink to page
That HTML engine is hopelessly outdated, so I'd recommend against it.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 8th, 2005, 04:06 PM
#7
Thread Starter
Frenzied Member
Re: hyperlink to page
Thanks guys, but I'm just gonna have to scrap the idea. I searched every inch of google and found nothing. Several instances allow you to use other components, but not one that I'm using. This is on an applet so I think I'll just use a little side html to create a few links using anchor tags. Anyways, thanks for helping out...sorry we coudln't find an end to this.
-
Jul 8th, 2005, 04:26 PM
#8
Re: hyperlink to page[Resolved]
Oh, you're talking about applets!
Then it's simple. If 'this' is the Applet-derived class, you simply do:
this.getAppletContext().showDocument(newUrl);
So in order to create hyperlinks, you need text controls that react to clicks by doing the above.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 8th, 2005, 04:35 PM
#9
Dazed Member
Re: hyperlink to page[Resolved]
Jesus i wish you told us you were working with Applets from the begining.
-
Jul 8th, 2005, 05:36 PM
#10
Thread Starter
Frenzied Member
-
Jul 9th, 2005, 04:32 AM
#11
Re: hyperlink to page[Resolved]
 Originally Posted by Dilenger4
Jesus i wish you told us you were working with Applets from the begining. 
Hehehe...me too. I was looking in all My java books for a solution, and jumped over all Applets chapters... ..
-
Jul 9th, 2005, 10:47 AM
#12
Thread Starter
Frenzied Member
Re: hyperlink to page[Resolved]
I knew it was an applet and had searched google for endless hours, but was making things too hard!
-
Jul 9th, 2005, 12:26 PM
#13
Re: hyperlink to page[Resolved]
Applets have a very limited API, the best place to look is the java.applet package in the official docs.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|