Link a URL in Java

Hallo all,
I need your help ;) I am having a JTextArea and I want to write into this JTextArea a kind of URL link like http://www.abc.com and when the user clicks on this link it will open this link in a browser. How can I manage to do it? Do you know a tutorial site or a brief example for it?

SomasekharPatil wrote:
Use html code to display the link http://www.abc.com
Example http://www.abc.com
Make sure that JTextArea is html enabled.The API does do say "displays plain text". Do you mean a JEditorPane? Even then to make it open in a browser rather than just the editor pane you need to do a little more than simply include the link, you also need to write a HyperlinkListener that calls [Desktop.browser|http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)].
@OP
[*Java Tutorials: * How to Use Editor Panes and Text Panes|http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html]

Similar Messages

  • Regarding Link to URL UI Element in a table

    Hi All,
    I am using "link to url" UI Element in a table column. I have mapped the column (i mean the "reference" property of "link to url" UI to a bapi node). Now, when I am populating the table, for some rows the bapi is not returning the url links. So, the column is getting disabled and not even showing the links for the rows which are getting the url link from the bapi.
    Is there any way to set the mapping row wise, so that the rows which have data get enabled with the link and which do not have data will be disabled.
    Also, can I make the whole table readonly, except for one column.
    Please help me in this regard.
    Regards,
    Murthy.

    Hi Armin,
    Thank you very much. The problem is solved. 10 points for you.
    Another Question.......
    Can we make the table readonly, leaving just one column to select.(that is the column with link to url). Is it possible? If so, please tell me how....
    Also, can you tell me the reason for the following exception.....
    <b>com.sap.tc.webdynpro.progmodel.context.ContextConfigurationException: DataNodeInfo(CreateTemplateComp.Zad_Bapi_Get_Template_Details_Input.Output.T_Template_Details): structure field Ad_Height not found
        at com.sap.tc.webdynpro.progmodel.context.DataAttributeInfo.init(DataAttributeInfo.java:299)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.initUnmappedAttributes(NodeInfo.java:687)
        at com.sap.tc.webdynpro.progmodel.context.DataNodeInfo.doInit(DataNodeInfo.java:238)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:671)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
        ... 49 more</b>

  • How to open the pdf document from KM  through Link to URL UI element

    Hi All,
    I have Link to URL UI element  in webdynpro java layout - on click of the link we need to open the pdf document from KM respository.
    KM Document location : irj/go/km/docs/documents/RHPortal//USA/A/Test/Employee_details.pdf.
    Once this is transported to Test and Production portals , we need to retrieve the KM document from the respective portal location through the Link to URL UI element .
    Thanks,
    Portaluser100

    Hi,
    If you set the link to your document in a Context attribute by using a relative path this should work just fine.
    Example:
    wdContext.currentContextElement().setUrl("/irj/go/km/docs/documents/RHPortal//USA/A/Test/Employee_details.pdf");
    Bind that attribute to the reference property of the LinkToURL element.
    Cheers,
    Leo

  • Link to URL -- pdf should open in new window - Error

    Hi experts,
    I have a Web Dynpro Application with an ALV and a link to url in one column. The code is ok. It works fine. When I click on the URL a new browser window opens with the correct URL, but I get an Error --> "The requested URL could not be retrieved".
    It should be a pdf. But Acrobat Reader does not open. If I put the URL in Firefox Browser, it works perfect. Acrobat Reader opens and shows the pdf.
    The same happens when I use Windows 2000 System with Internet Explorer version 6.0.2800.1106.
    I have normally Windows XP with Internet Explorer version 6.0.2900.2180 with sp2.
    What can that be? On both computers I have the same version of Acrobat Reader with the same configuration.
    Had someone of you this problem, too? Who can help?
    Thanks a lot.
    Best regards,
    Ingmar

    I answered it myself. I had to look that for the called server no proxyserver will be used...

  • Open URL from Java in a new browser tab

    Hi OTN,
    Surprisingly can't find the implimintation.
    In an ADF managed bean I retrieve String url. I need to open a new browser tab with this url.
    Found this thread Open a url in a new window in the backing bean which shows using javascript "service.addScript(facesContext, "window.open(http://www.google.coml)");".
    But in my case in doesn't work. The code is executed, but nothing happens. Maybe because the bean is called from a taskflow inline popup.
    ADF 11.1.1.4
    Thanks.

    Well, I'm afraid that is not an option.
    The goButton is in a table row. There are lots of rows so if I use EL for Destination attribute the URL would be retrieved for each of rows.
    The method of URL retreiving is heavyweight operation which includes calling plsql functions, working with strings and others. So if I do it for each table row my application hungs and then I receive an exception of CPU usage.
    That's why I switched to normal commandButton witch actionListener which retrieves url on click - only once. So I need to open URL from Java.

  • "Create links from URLs" preference no longer working in sticky notes

    I work with reading other people's sticky notes in Adobe Acrobat X Pro (now version 10.1.1). When they wrote URLs in the sticky notes it used to recognize them as links; now they're just plain text. My Preferences > General > "Create links from URLs" option is checked ON. I aso tried View > Tools > Document Processing > "create Links from URLs" and it added two links but only outside of the sticky notes. I am on Windows 7 Professional 64-bit. Thanks.

    AFAIK, URLs inside annotations were never converted into actual links. I'm not even sure it's technically possible to do so.
    It might have happened if the annotations were flattened and the text in them became a part of the static text of the PDF. Then the URLs in it could have been converted into "live" links, but not before.

  • How to hide the URL path on click of an link to URL element,from user

    Hi All,
          I have an link to URL element, on click of the link it opens the specified url in a new window. But in new window the user is able to see the entire URL path. I want to hide this path from the user. Can any one please suggest me how to do it.
    Regards,
    lakshmi.

    hi,
    just check this help
    http://help.sap.com/saphelp_nwce10/helpdata/en/f7/f289c67c759a41b570890c62a03519/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/7d/fdc99ab37a8d42892e0d39bbd23be8/frameset.htm
    Link to URL Question

  • How to validate a url in java script

    Hi to all.
    can any one send me the code to validate a url in java script
    thanks in advance

    How about Google? There are several JavaScript code samples available on the web.
    xH4x0r

  • Link to Url properties problem

    Hello all,
    i am working on link to url UI element.
    the url that i have is larger than that i can put in reference property of link to url UI Element.
    How may i put whole of the url in reference properties of  link to url UI Element without length problem.
    Thanks & Regards.
    Vikash

    workaround:
    create an action and open the link via WINDOW API or with an exit plug
    http://help.sap.com/saphelp_nw04s/helpdata/en/45/1bc575ba064574e10000000a114a6b/content.htm
    regards
    stefan

  • Links to URLs don't work in published file - Captivate 4

    In Captivate 4, my links to URLs do not work in my published file.  I am rolling this out via email to a small number of people.

    Hi there
    Likely you will need to ask each user to configure their list of Trusted Locations for the Flash Player to allow your Captivate to operate the URLs.
    Here is a small tutorial on configuring the trusted locations:
    Click here to view
    Cheers... Rick

  • Link to URL - How to Open a New Tab

    I have created some PDF's in Adobe Acrobat and I am hosting them on my website. So for example here is one: <possible spam link removed - kglad>
    I have created links to URL's using the Link Properties tool, Actions tab. However it will only open the URL in the same tab.
    Is it possible to have the URL's open in a new tab?
    Hope someone can help.
    Heath

    You need to use the target="_blank" attribute to make links open in a new window or tab. Where the link actually opens is up to the browser settings. So if you have Tools > Internet Options > Tabbed Browsing Settings > "Always open pop-ups in new tabs" selected, a target="_blank" link will open in a new tab. Note that this type of link will open in a new window by default on most browsers.

  • Link to URL in a table

    Hi,
    I want to insert a link to url in a column of a table dynamically.
    Iam able to create the column and the link to url also.But i dont know how to set thid link in the column of the table.
    Please suggest.
    Regards,
    Padmalatha.K
    Points will be rewarded.

    hi,
      use this code for creating dynamic table and link to action  as a table cell editor.
    public static void wdDoModifyView(IPrivateDynamicCompView wdThis, IPrivateDynamicCompView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
           if(firstTime){
                IWDGroup theGroup = (IWDGroup)view.getElement("InputGroup");
    // name of the group in the view layout
           IWDTable table = view.createElement(IWDTable.class);
           IWDTableColumn column = view.createElement(IWDTableColumn.class);
           IWDLinkToAction linktoaction = (IWDLinkToAction) view.createElement(IWDLinkToAction.class);
      IWDAction action = view.getAction("Action");
    linktoaction.setOnAction(action);       linktoaction.bindText("test.test");
    // context node (test)and attribute(test) binding the path to the link to action text property
           linktoaction.setEnabled(true);
           linktoaction.setImageFirst(true);
           linktoaction.setVisible(WDVisibility.VISIBLE);
           column.setTableCellEditor(linktoaction);
    IWDCaption caption = view.createElement(IWDCaption.class);
           caption.setText("header");
           column.setHeader(caption);
           IWDNodeInfo node = wdContext.nodeTest().getNodeInfo();
           table.bindDataSource(node);
           table.setEnabled(true);
           table.setFooterVisible(true);
           table.setRowSelectable(true);
           table.setVisibleRowCount(5);
           table.setDisplayEmptyRows(true);
           table.setSelectionMode(WDTableSelectionMode.AUTO);
          table.addColumn(column);
               theGroup.addChild(table);
        //@@end
    Note: create a Action in the View Controller , in the above code the action is named as Action.
    hope your problem gets resolved
    thanks and regards
    fazal

  • URGENT: pass parameters from report to report without usting a link or URL

    HI.
    I want to send an ID field from a report to a report (like master-detail) and that should be done by pressing the next or previous button. So, not with a LINK or URL link.
    Is that possible? I used the wwsto_api_session package in several ways, but no luck so far.
    Thanks,
    Paul.

    If your requirement is to provide buttons that take the users to another report, you have to do the following:
    In your source report (report A), create a form containing a button. Use hidden fields for the parameters you have to pass to the target report (report B).
    You'd need to base your report A on a SELECT statement. One of the columns in the SELECT statement can be a string where you actually construct the entire HTML form, something like:
    SELECT ...., '<form action=... method=post> ... ' FROM ...Hope this helps.

  • Issue linking external URL's in task list

    When I link a URL to a task list, a pop-up at the bottom of the screen saying "Only secure content is displayed" with a button saying "Show all content"
    When I select "Show all content" an Internet Explorer pop-up appears asking to either "Leave this page" or "Stay on this page."
    Selecting "Stay on this page" does nothing, but selecting "Leave this page" logs me out of Planning. When I log back in, the web page appears when I click on the task list.
    When I log off and close my browser, I have to go through the same steps.
    Is there any way to have the URL task list work without having to go through those steps? Is this an IE security setting?
    Thank you in advance for any input.
    Tiffany

    What URL are you using, is that an FR or WA report? If so check this Oracle - Hyperion Labs......: Generate Smartcuts for all objects under a folder
    Regards
    Celvin

  • Calling tcode using link to url

    hi friends,
    i want to call tcode SE38 in webdynpro application by using linktourl.
    here i am going to
    shuffler
    system
    webgui in internet service
    and then right click on it then 
    publish->complete service.
    and later i am going to tcode sicf
    here i am giving the path  /sap/bc/gui/sap/its/webgui and activate it
    what is the need of giving the path here
    and who is going to give the path as default....?
    can anyone explain clearlly..
    Thanks in advance
    karunakar
    Edited by: bkarunakar on Jul 19, 2011 3:56 PM

    Hi Karunakar,
    Goto SICF.
    Select the path as : /sap/bc/gui/sap/its/webgui
    right click on webgui and click on "test" to execute the servies.it will open the sap screen in web browser.
    **NOTE : if it gives an error you need to do some setting Reply if you want the steps for setting.**
    create LINK to URL or LINK TO ACTION according to requirement.
    use URL as   URL = 'http://<url>:portno/sap/bc/gui/sap/its/webgui?~TRANSACTION=SE38'. //
    "Note : you can find this url in ur WEBDYNPRO Application Properies
    lo_api_component = wd_comp_controller->wd_get_api( ).
    lo_window_manager = lo_api_component->get_window_manager( ).
    ld_url = FINAL_URL.
    CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
    EXPORTING URL = url
    RECEIVING WINDOW = lo_window.
    lo_window->open( ).
    Also check this...
    Re: Reg calling Transaction code in Webdynpro ABAP
    Cheers,
    Kris.

Maybe you are looking for

  • Issue with report FAGLL03

    Hi I have an issue with the SAP report FAGLL03. There is a document posted in the system with the posting date in previous year but document date in the current year. I can see this document in the document display and BSEG but when I go to FAGLL03,

  • Adobe Reader continuously crashes

    Hi, My issue is described in the error message below. I am hoping that someone can help as I need to do some work! Thanks! Process:         AdobeReader [9207] Path:            /Applications/Adobe Reader.app/Contents/MacOS/AdobeReader Identifier:     

  • HT1296 how do I transfer a PDF document from my laptop to my Ipad?

    Hello how do I transfer a PDF document from my laptop to my Ipad?

  • Iweb RSS location

    Hi, I wish to change the default location of the RSS feed which is generated by iweb so that it will be correct when i upload my files to my ftp site. Does anyone know how to do this? Currently i get the following when i click my rss button online: T

  • Embed PDF in a Flex Application

    Hi All, I am trying to embed a PDF Document in a Flex Container, but I think it is impossible.. Some people talks about iframes, but it is not a nice workarround at all. I have read that in Adobe Air it is possible to do that. ¿Why in Adobe Air and n