Open link in a browser from jTexPane hyperlink

Hi,
I create a hyperlink in a jTextPane, and it's like this:
jTextPane1.setContentType("text/html");
jTextPane1.setText("<a href=http://www.yahoo.com>Yahoo!</a>");
It's working, but then the yahoo page is displayed in that jTextPane1..How do I change it so that the page is opened in a default browser?
Thanks for your time.

Heres a little snippet that might do what you are after ... NB: this runs an linux box that has the application firefox in its path, thus able to run ... you might need to use the full path of iexplorer eg c:/windows/program ...etc
hope this helps
public class run
  public static void main(String[] args) throws Exception
       String url = "http://slashdot.org";
       Process p = Runtime.getRuntime().exec("firefox " + url);
       p.waitFor();
       System.out.println("Done.");
}

Similar Messages

  • Safari opening linked .zip files directly from DVD instead of downloading

    Dear all,
    Safari opening linked .zip files directly from DVD (via Windows explorer) instead of downloading it tru browser click - it's working just fine in FF, Chrome IE. Is this a known issue? or something can be done by modifying browser setting/pref.
    Expecting more advise on this.
    Configurations: Windows XP
    Safari: 5.1.7
    Note: ensured there is no space in the file path, just linked the .zip file using href attribute!
    Also tried with .xls, .doc insted of .zip same issue appearing.
    Thanks in advance,
    Thirilog

    Hi
    appzapper & such are pretty flaky at removing things usefully, imo.
    Use the uninstaller for speed download - http://www.yazsoft.com/products/speed-download/faqs/?how-to-un-install-speed-dow nload-properly
    or get a hold of FindAnyFile or easyfind & search for Growl & Speeddownload & yazsoft - but from all I hear, the uninstaller works fine.
    Failing that, Safari's settings plist file isn't in caches
    Home/Library/Preferences/com.apple.safari.plist
    is the place
    & if you're still stuck, test & maybe download another browser using a New User Account.

  • Discoverer Viewer Open Link in New Browser Window

    We have created cubes with links to details (using Manage Links).
    When selecting the link from Discoverer Plus OLAP, a new browser window opens.
    When selecting the link from Discoverer Viewer, it opens within the same browser window.
    How can we force Discoverer Viewer to open a link in a new browser window?
    We tried adding the TARGET="_blank" to the link but that only gets added to the last parameter (or passed as a parameter).
    Unlike Discoverer Plus parameter, there is no _popup option.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This article by Ted Padova will give you the JavaScript code that will accomplish this: http://acrobatusers.com/blogs/tedpadova/opening-pdfs-new-browser-windows

  • ADF RichTextEditor opening links in new browser - how to do it?

    Hi, If I add a link in ADF RichTextEditor, how do I make it open in a new browser window when clicked on it? Essentially, I want RichTextEditor to insert "target=_blank" attribute in the achor element rendered.
    Of course, I can ask the user to go to source mode and do it themselves, however, I was hoping that in the WYSIWYG mode, RichTextEditor would give me the options for specifying the target.
    Is this possible?
    BTW, I dont want to process the value of the RichTextEditor at the backend and insert the target programmatically.
    Thanks.

    The question is: how do I detect if the clientaborts
    the downloading by pressing the stop button on theweb
    browser?Short answere: You dont.It doesn't terminate the socket? How/when does the socket get closed on the client side then?

  • [SOLVED] Xfce terminal open links with wrong browser.

    After installing Opera as second browser, xfce terminal began to open links with it, instead of my default browser - Firefox.
    I right click on an URL, choose 'Open Link' and it opens in Opera.
    Firefox is set as default browser in Settings -> Preferred Applications -> Web Browser
    xdg-open http://archlinux.org
    - opens Firefox
    exo-open http://archlinux.org
    - opens Firefox
    After quick search through xfce terminal sources i found it uses some function - gtk_show_uri.
    I googled it, found that topic: https://bbs.archlinux.org/viewtopic.php?id=140028 and tried the solution:
    cat ~/.local/share/applications/mimeapps.list
    [Added Associations]
    x-scheme-handler/mailto=exo-mail-reader.desktop
    x-scheme-handler/http=firefox-browser.desktop
    strangely it doesn't help.
    After all righ click url in terminal and 'Open Link' still uses Opera.
    Any ideas? What else can i do to find out a reason?
    Last edited by spacetekk (2015-01-04 11:41:53)

    Tried BROWSER envar - doesnt help, and as i understand it must work only for cli apps.
    Editing of  ~/.config/mimeapps.list doesnt help eather:
    cat ~/.config/mimeapps.list
    [Default Applications]
    text/vcard=firefox.desktop
    text/html=firefox.desktop
    [Added Associations]
    text/vcard=firefox.desktop;
    text/html=firefox.desktop
    but maybe it's not correct.
    After that i tried to strace xfce4-terminal:
    poll([{fd=4, events=POLLIN}], 1, 4294967295) = 1 ([{fd=4, revents=POLLIN}])
    recvmsg(4, {msg_name(0)=NULL, msg_iov(1)=[{"\34\0.\331!\t`\2N\1\0\0\330\336\7\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 352
    recvmsg(4, 0x7fff5ad349d0, 0) = -1 EAGAIN (Resource temporarily unavailable)
    stat("/home/user/.local/share//mime/mime.cache", 0x7fff5ad34470) = -1 ENOENT (No such file or directory)
    stat("/home/user/.local/share//mime/globs", 0x7fff5ad34470) = -1 ENOENT (No such file or directory)
    stat("/home/user/.local/share//mime/magic", 0x7fff5ad34470) = -1 ENOENT (No such file or directory)
    stat("/usr/local/share/mime/mime.cache", 0x7fff5ad34470) = -1 ENOENT (No such file or directory)
    stat("/usr/local/share/mime/globs", 0x7fff5ad34470) = -1 ENOENT (No such file or directory)
    stat("/usr/local/share/mime/magic", 0x7fff5ad34470) = -1 ENOENT (No such file or directory)
    stat("/usr/share/mime/mime.cache", {st_mode=S_IFREG|0644, st_size=115108, ...}) = 0
    open("/usr/share/applications/opera.desktop", O_RDONLY) = 13
    fstat(13, {st_mode=S_IFREG|0644, st_size=550, ...}) = 0
    read(13, "[Desktop Entry]\nVersion=1.0\nName"..., 4096) = 550
    read(13, "", 4096) = 0
    close(13) = 0
    access("/usr/local/sbin/opera", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/local/bin/opera", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/bin/opera", X_OK) = 0
    getuid() = 1000
    stat("/usr/bin/opera", {st_mode=S_IFREG|0755, st_size=416, ...}) = 0
    access("/usr/local/sbin/opera", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/local/bin/opera", X_OK) = -1 ENOENT (No such file or directory)
    access("/usr/bin/opera", X_OK) = 0
    getuid() = 1000
    stat("/usr/bin/opera", {st_mode=S_IFREG|0755, st_size=416, ...}) = 0
    pipe2([13, 19], 0) = 0
    pipe2([20, 21], 0) = 0
    clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fd725cf1bd0) = 1469
    close(19) = 0
    close(21) = 0
    wait4(1469, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 1469
    and it's strange but as i can understand it uses some mime cache file located at /usr/local/share/mime/mime.cache
    and before that some other non existing files, but i dont see there any familiar config files.

  • What is the shortcut key instead of using right-click on the link and selecting "Open Link in New Tab" from the context menu?

    I want to use from keyboard(to hold this for example T)and left-click on the link to open the link.Exactly my question is about "Opening links in a new tab".I prefer to use LEFT-click.thank you so so much.

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")

  • How to open report in the browser from PL/SQL procedure

    Hi,
    I need to call the report (with destype = SCREEN) from the PL/SQL procedure and display in the browser.
    For Example: when I call P_call_report procedure in my Forms6i button or at sql*plus, the report output PDF/HTML should open in the Browser window.
    Iam Using IE, report6i, forms 6i, Oracle 8.1.7, Windows OS
    I tried using UTL_HTTP(' ') in a procedure. But when I execute the procedure at sql*plus it says Pl/sql procedure completed successfully message without opening report output in the browser window. If I copy the same url and paste it in the browser, it works.
    Please let me know if there is any solution.
    thanks alot.

    I guess event driven publishing may work. But Iam not sure about the opening of the browser from inside the procedure.

  • Can not open links while in browser?

    So, I can't click on links with the cursor while I am in browser,  if it highlights the link I can right click and hit open link, but can not just click with the trackball, does anyone know how to fix this?

    I asked your device operating system release?
    lol, no, not a virus.
    The most recent OS release you're likely running contains a bug. Just hover over the link and press Menu > Get Link.
    it's be fixed in a later release.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Want to open link in new browser

    hi
    can anyone tell me how to set a link so that when someone
    clicks on it the website it is linked to opens in a new browser. I
    could not find the place in dreamweaver to tell it to do that.
    thanks
    edward

    On 11 May 2008 in macromedia.dreamweaver, egc2224 wrote:
    > can anyone tell me how to set a link so that when
    someone clicks on
    > it the website it is linked to opens in a new browser. I
    could not
    > find the place in dreamweaver to tell it to do that.
    F1 > Open Browser Window behavior
    The other alternative is to add a target="_blank" attribute
    to the link
    tag, but that's deprecated. It should also be noted that many
    modern
    browsers open new windows in new tabs, not new windows, and
    you have no
    control over that.
    Joe Makowiec
    http://makowiec.net/
    Email:
    http://makowiec.net/contact.php

  • Open URL in Web Browser from a Java Application

    Hi,
    I have an HTML document that I want to load in a browser window by clicking on a button in my java GUI application.
    Any suggestions?
    Thanks.

    You can use the Process class to start the web browser with the proper command line arguments (depends on the web browser though). Or on windows, you can have your program create a batch file with the code start url (where [url] is your url), and this will open the default web browser when run (again you must run it with a Process).

  • Can i open a page in Browser from an applet

    i want to open a web site in a new browser window from an applet.
    Is it possible. if posible then send me some links or codes
    thank you

    Do you know how to use applet to link to another webpage? set the target = _blank
    public class App extends Applet {
    getAppletContext().showDocument(new URL("http://java.sun.com"),"_blank");
    }

  • Opening link in separate browser window

    Is there a way to make a NEW browser window open when creating a hyperlink to a page outside (external) of my website? My external links always open in the same window as my website resulting in the viewer being taken off my site.

    Check out this link:
    http://web.mac.com/varkgirl/iWeb/Aardvarkland/Open%20links%20in%20new%20window.h tml
    Basic summary of what the link says:
    1. Publish your page. Changes will be made in the published files.
    2. Get MassReplaceIt
    http://www.hexmonkeysoftware.com
    http://web.mac.com/will.englefield/iWeb/WillG4PB/MRI.html
    3. Set up MassReplaceIt
    Find
    href="http
    replace with
    target="_blank" href="http
    This will change all of your external links to open in a new window and leave your internal links as is.
    Remember, if you make a change to a page like this post-publishing, and later re-publish, you have to make the html changes again! Save your query in MRI for next time

  • Opening Link in fullscreen browser window

    I have this action on a button and want it to open the link
    in a fullscreen browser window. What did I screw up?
    on (release) {
    getURL("javascript:ContactObj=window.open('
    http://www.villagegreenstudios.com/view2/BTAdemos.html','btawdemoswin','scrollbars=Yes,sta tus=No,resizable=Yes,fullscreen=Yes');
    ContactObj.focus(); void(0);");
    }

    Looks pretty good to me. Sometimes if I'm having trouble with
    doing things this way, I whip up a quick function in javascript on
    the html page that does the same thing and just call that function
    with getURL or externalinterface. Saves me from having to debug
    quotation mark issues.

  • Open link in new browser window

    I know how to enter the links in the assets page so when I
    export to dreamweaver the links already in the html. Is it possible
    to enter a link URL and have it open in a new window? I know that
    you can use the popup feature but is there any other way?
    Thanks

    I used the Behaviors tab to do this (see:  www.adobe.com/support/dreamweaver/interactivity/behavior/behavior04.html). 
    The page I was starting from is http://www.wqma.com/schedule.html.  I wanted to click on a link and have it open a new window with a .pdf of our schedule.
    When I strictly followed the instructions in the above Adobe link, I ended up having a new window open with the link I wanted.  In addition, however, the old window *also* opened to the new page.  Then I tried deleting the address within the '<a href=...>' parentheses.  (I assumed that's what Linda meant by leaving it blank.)  But when I did this, the initial page jumped back to my home page.  So instead, within the '<a href=...>' parentheses, I entered the address for the page I was starting from (<a href="http://www.wqma.com/schedule.html">).  This made the first window "stay" on the page I was starting from, and also opened another window with the page I wanted.

  • Open links in new browser window

    We are using Oracle WCI 10.3/Collaboration 10.3 and have a Community Links Portlet (collab portlet) setup. The links open up in the same browser window and to get back to the portal, the user has to hit the back button on the browser. So,
    1) Is there a portal/collaboration configuration that enables links to open up in a new browser window?
    2) Is there a way to hide the address bar when the link opens up in a new window? (the reason for this question is, we may have a link to some applications where we don't want the user going in directly. So, by hiding the address bar, they can't copy the URL and access directly without going in through the portal).
    If there is any better way to do question 2 above, would appreciate the feedback.
    Thanks.

    I was able to figure this out:
    1) In the My Account section, under display preferences, there is an option to "open documents in same window" or "new window". By changing this, links in the Community Links portlet open up in a new browser window.
    2) With a simple javascript example that I found on the internet, I was able to customize the popup browser window with no address bar or menu buttons.
    Edited by: user1301820136 on Jun 26, 2009 9:59 AM

Maybe you are looking for