Get JEditorPane to display new URL...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Get JEditorPane to display new URL...

Hybrid View

  1. #1
    Mike Jewson Guest

    Get JEditorPane to display new URL...

    Hello,

    I have created a JEditorPane that will show HREFs to pages in an Applet.

    I can get the URL that the HREF is pointing to.
    I don't want the JEditorPane to display the new URL.

    How do I get the web browser to follow that link??
    or
    Could I have a new web browser open that is directed to the new URL and if
    so how??

    Thanks.

    Regards,
    Mike Jewson



  2. #2
    Tom Duffy Guest

    Re: Get JEditorPane to display new URL...


    Hello Mike:

    To get the browser to navigate to any URL, pass in the URL object to:

    getAppletContext().showDocument(url);

    To get a new browser window to pop up, use the same method (overloaded) and
    pass in the URL and a frame name - in this case "_blank":

    getAppletContext().showDocument(url, "_blank");

    HTH,

    Tom Duffy

    "Mike Jewson" <mjewson@knovel.com> wrote:
    >Hello,
    >
    >I have created a JEditorPane that will show HREFs to pages in an Applet.
    >
    >I can get the URL that the HREF is pointing to.
    >I don't want the JEditorPane to display the new URL.
    >
    >How do I get the web browser to follow that link??
    >or
    >Could I have a new web browser open that is directed to the new URL and

    if
    >so how??
    >
    >Thanks.
    >
    >Regards,
    >Mike Jewson
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center