Results 1 to 13 of 13

Thread: hyperlink to page[Resolved]

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Resolved 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.

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    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.

  3. #3

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: hyperlink to page

    But how do you actually open a page when you have the URL object?

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.

  5. #5

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.

  7. #7

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    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.

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.

  9. #9

  10. #10

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: hyperlink to page[Resolved]

    ewwwwww that did it!!!! Thank you sooo much for your help guys, this was a three day head banging against wall problem for me.


    Dillenger, all you had to do was ask

  11. #11
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: hyperlink to page[Resolved]

    Quote 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.....

  12. #12

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: hyperlink to page[Resolved]

    I knew it was an applet and had searched google for endless hours, but was making things too hard!

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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
  •  



Click Here to Expand Forum to Full Width