Hyperlink in a jTextArea

Hi
I've different strings of text which I wrote in a jTextArea. How can I implement that when I click on one of these text-lines I can excute an ActionEvent? Should be something like the hyperlink system; however to an other jTextArea.
Thanks in advance

Sounds like you may want to use a JEditorPane

Similar Messages

  • How to make hyperlinks in JTextField/JtextArea  ??

    My JTextField/JtextArea has got this Text.
    String text = "Get information from http://www.hotmail.com, if you have problems go to http://www.google.com " ;
    How to make hyperlinks for http://www.hotmail.com and http://www.google.com texts only???
    And how to call those sites???

    Add a mouse listener, when the user double clicks - see if they've clicked on text that is a valid link.
    The limitation of using textfield or textarea is that you get no styling. I dont know why you're refusing those suggestions, but you're just creating more work for yourself.

  • Write hyperlink to JTextArea

    Hi, I am new in Swing.
    I am using JTabbedPane with some buttons and JTextArea to write a link names there.
    Is it possible to write this links to JTextArea as hyperlinks and add action listener there to start browser when user click on it ?
    Thank's.
    andrews

    No - you'll need a JEditorPane. The API documentation (http://java.sun.com/javase/6/docs/api/javax/swing/JEditorPane.html) gives an example of link click handling. Sun's tutorial discusses editor panes here: http://java.sun.com/docs/books/tutorial/uiswing/components/text.html and later here: http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html
    You should be aware that JEditorPane acts a pretty minimal browser - but you could adapt the example in the API documentation to launch a browser.

  • Dynamic Hyperlink underline

    Hi all,
    I am writing an application, where the user can input text in a JText Area.
    I would like to add a feature where when as a hyperlink is being typed in, it would automatically be highlighted/underlined/made clickable.
    MS Word and hotmail editors have something similar, i.e. after the third w of the www is typed in, the string is being automatically
    underlined/highlighted/made clickable.
    Any help would be appreciated,
    Yiannis

    You might find this is easier to do with a JEditorPane than a JTextArea.

  • Hyperlinks in chat

    Hi,
    I am developing a chat.My problem is that when client on one end sends a hyperlink to another client it gets displayed as text in client's Jtextarea.I want this hyperlink to be displayed as an actual hyperlink and along with that this link must open the actual site when the client clicks on the link.
    Can anyone send me some code which does the same as i have not been able to figure out the solution.
    Thanx in advance.

    You should use JEditorPane or JTextPane
    See this link for help http://java.sun.com/docs/books/tutorial/uiswing/components/text.html

  • JTextArea  / Disabling selection

    Im getting a bit frustrated with this, hence my post....
    I have a JTextArea, in which will contain various text.
    The component should not be editable, and likewise should not be selectable.....
    I still have not found a way to disable text selection in a JTextArea, in fact any subclass of JTextComponent for that matter.
    why setEnabled(false) does not prevent selection is beyond me........
    I had a similar problem once before, and my solution was to set selection color to thed, which worked just fine, despite not really solving the problem....
    I would probably go ahead and use this technique again, however I have a different situation here, Im using a translucent background, (0,0,0,0) and setting selection color to this value does not seem to work...
    Is there a way to totaly disable selection???
    Should I possibly use a different component to handle the task, which does not support selection, ( Ihavent found anything yet). I need to have line wrap so a few of the more basic components are out of question....
    Im hoping some would give me some suggestions on this, they will be greatly apreciated, and as always adequately rewared....
    Thanks
    J.Prisco

    I had a non-editable JEditorPane which I didnt want to select its text, if I'd set it to setEnabled(false) whenever I would've cross a hyperlink, The cursor would not change to a Hand-Cursor (because the comp. is disabled)
    So, What I did was just "disabling" the selection (not the comp.) by setting my own Caret as follows:
            JEditorPane lbl = new JEditorPane();
            lbl.setCaret(new javax.swing.text.Caret()
                public void install(javax.swing.text.JTextComponent c){}
                public void deinstall(javax.swing.text.JTextComponent c){}
                public void paint(Graphics g){}
                public void addChangeListener(ChangeListener l){}
                public void removeChangeListener(ChangeListener l){}
                public boolean isVisible(){return false;}
                public void setVisible(boolean v){}
                public boolean isSelectionVisible(){return false;}
                public void setSelectionVisible(boolean v){}
                public void setMagicCaretPosition(Point p){}
                public Point getMagicCaretPosition(){return new Point(0,0);}
                public void setBlinkRate(int rate){}
                public int getBlinkRate(){return 10000;}
                public int getDot(){return 0;}
                public int getMark(){return 0;}
                public void setDot(int dot){}
                public void moveDot(int dot){}
            });Again I remind you that this will only work good for non-editable text components...
    Cheers
    Eyal

  • JEditorPane and Hyperlinks...

    Hi together, I become desperate...
    I've a jEditorPane on the left in my application with several rows of text. any row should be a hyperlink to a special text, which I want to display in the jtextarea on the right (something like the searchsystem in ms windows, where you see all the topics left and when you choose a topic you see the details on the left).
    does anyone have an example or can give me some inputs how i implement the hypertextListener and how to know which textrow was selected?
    thanks in advance.
    steinfresser

    yes, but it's to big for my little application. is it not possible to insert a html file in a jeditorpane, where I can listen to the hyperlink? I've found a demo version of an applet in sdk1.4/demo/jfc/swingset2, but I didn't get the context. Does anyone know what's the reason and what happen in this lines?
    try {
    URL url = ;
    // System.getProperty("user.dir") +
    // System.getProperty("file.separator");
    String path = null;
    try {
    path = "/resources/index.html";
    url = getClass().getResource(path);
    catch (Exception e) {
    System.err.println("Failed to open " + path);
    url = null;
    thanks steinfresser

  • TextArea with formatted Text, Hyperlinks, and clickable Text with SWING?

    Hi again,
    Ok if I decide to use Swing, is there any TextArea which supports Formatted Text Hyperlinks AND clickable Text wich calls a callback routine??? I think formatted Text and Hyperlinks are possible with JTextArea and the RTF editorKit, but clickable text, in order to controll the program in some way???
    Could anyone help me?
    Greets

    Try the JEditorPane class.See the intro exapmle at the top of
    [url=http://java.sun.com/j2se/1.4.2/docs/api/javax/swin
    /JEditorPane.html] this page.That seems to be the solution! Can I use the JTextPane, too? Does a DefaultStyledEditorKit support Hyperlinks and Hyperlinklisteners, too?
    In order to realize callback functions I have to insert a HTML-Anchor with the Attribute as the Parameter for my method. Then my HyperlinkListener catches the HyperlinkEvent and the hyperlinkUpdate method reminds the parameter!
    Is that right?
    Thank you very much!
    Greets

  • Excel & Hyperlinking with Sharepoint

    I have a tracking document in Excel that has each entry linked to another place on Sharepoint to locate files and intranet articles. There are no formulas or other complex entries....just text and hyperlinks.
    If I open the Excel file in Sharepoint and edit it there, we have no issues.
    If I download the Excel file to my desktop...all links to other files are broken (the intranet file links remain active). When I try to access the link I receive a pop up window that states, "Cannot open the specified file."
    This is a file accessed by multiple people and used as a resource, there are well over 100 linked entries and the group would like to be able to use the file on their desktops.
    I have already found and unchecked the "Update Links on Save" option. This now allows me to download the file to the desktop, have no access to the links, and then upload it where I can then access the links again.
    Is there any way to preserve the links so they can be accessed on the desktop?
    Software Specs
    Windows 7
    Office 2010
    Explorer 8
    Thank you,
    Christine

    The links are absolute. All links are to our internal team site or to our intranet. The intranet links aren't affected.
    This wasn't an issue before the company upgraded us to Windows 7/Office 2010.
    The links are established (right click, select Hyperlink, copy/paste from browser) while the Excel file is on the desktop and all work fine there.  The Excel file is then uploaded to Sharepoint where the links continue to work. When the Excel file is
    downloaded to the desktop again...all links are broken. If I re-upload it to Sharepoint though, it is fine.
    I double checked the actual link. It reads the same on the desktop initially as it does on Sharepoint. When the file is downloaded to the desktop again it seems to be missing the first half of it. What function could be editing the link?
    Christine

  • A problem with hyperlinks in my Interactive PDF on smartphones...

    I hope someone can help...  I exported both an interactive and for print PDF from inDesign.  When I view the PDFs on my pc the hyperlinks that I've made in the document work perfectly fine.  When I view the PDFs on my smartphone, the hyperlinks don't work.  I've gone through many forums to make sure all my settings were correct and have tried many different things to try to get them to work, but still no luck.  Has anyone come across this issue?  Is there any way to get these hyperlinks to work on a smartphone?

    Interactive PDFs on mobile devices are nothing short of a crapshoot.
    The readers are hit or miss and the better ones require payment.
    I wish I had better news for you but right now, that’s the way it is.
    Bob

  • Report navigation after creating hyperlink

    Hi,
    I am using Webi rich clinet XI R3.1. I have one main report with six dashboards and associated detailed reports. I created hyperlink for each of the dashboard and linked to detailed report in infoview.
    If i need to see main report i've to close this detailed report.Now how can i make the detailed report open in same window and navigate forward and backward to the main report instead of closing.
    I would appreciate if some one could provide any work around available if possible atleast.
    Thanks,
    Eswar

    Hi
    Create two links one Back and one Next in each report.
    Drag two free standing cells in the report and use opendocument syntax to create the links.
    The thread Re: Hyperlink Back functionality may give an idea.
    Regards

  • Hyperlink and Report Parameters

    Hi,
    I have a webi report which has drill filters. I have a drill filter on Month_Name_And_Year column. When I select the drill filter it gives me the report for that particular month_year. In the webi I also have a hyperlink to a nre report which is a detailed report. When the user clicks on the hyperlink I would want them to open the report  for the drill filter value that I select. I believe i need to pass the drill filter value as a paramter and how would I be able to open the detail report for the drill filter that I have selected.
    the code as a hyperlink is as follows:
    ="<a href=http://dev/businessobjects/enterprise115/InfoView/scripts/opendocument.aspx?sType=wid&sDocName=A%20WEBI%20Curd%20Installations&sWindow=New&sPath=[Breed],[Portal Analytics],[Supplemental Services]>"+[Number Of Curd Sales]+"</a>"
    I would require guidance what changes i wil have to make it at hyperlink and the detail report level to have it in sync with the summary report.
    Thank You,
    boe user

    boe user,
    Try this:
    ="<a href =" + "http://webwasqwn1.ecorp.cat.com:8322/OpenDocument/opendoc/openDocument.jsp?sType=wid&sDocName=fsitem&lsSEnterItem Node Name:="Query 2.Item Node Name(If IsPromptAnswered("Enter FS Items") Then "&lsSEnterFS Items:="+URLEncode(UserResponse("Enter FS Items:"))) + Object + ""
    Have a look on this thread also:
    Linking 2 web I reports
    I'm Back

  • Open hyperlinks from database

    Hi,
    I have a table in database that has files uploaded from front-end like XLS, DOC, PDF,TXt etc.
    I need to create a report that shows the filename as hyperlink and when user clicks the link, it should open the attachment in Excel if .XLS, Adobe if .PDF ..
    Ex: Filename
    Test.xls
    plan.Pdf
    roadmap.doc
    Where all entries under "Filename" column is hyperlink and when user clicks hyperlink, it opens the appropriate document
    Can we get this done in BI Publisher out of the box or do we need any custom code?
    Advance thanks to everyone for their valuable feedback.
    Edited by: S00000 on Sep 14, 2012 12:15 PM

    ok
    >
    I have a table in database that has files uploaded from front-end like XLS, DOC, PDF,TXt etc.
    >
    in my humble opinion it's not good solution
    why in table? why not use bfile?
    if you want select blob from your table you must always download it to some directory on server in sql/plsql way
    or if you use, as example, c#client then you can download it as byte stream to client side
    if you use bfile then your file stored on some server directory and you can work with by ftp, http as for ebs sample
    so in this case you can't have problem with attachment, you can use url+filename in your report
    --add
    >
    Iam looking for a solution where I can show attachments in BIP report from Database directly.
    >
    i not sure as it looks like
    one big report with embedded many other files?
    or how?
    Edited by: AlexAnd on Sep 19, 2012 11:21 PM

  • Clicking on the View More in Outlook....hyperlink does nothing!!

    Does this work for anyone using Lync 2013 FE, Lync 2013 client on Windows 7. Exchange version is 2010 SP3. Everything in the client works just fine but when I click on the Conversations tab, I see conversations going back about 6 months. I have conversations
    going back a year in my Conversation History folder in Outlook. When I click on the hyperlink on the bottom of the Conversations page, "View More in Outlook", nothing happens. No error, no popup at all. My configuration looks good. MAPI and EWS report
    OK. Everything else works fine. A bug perhaps?
    Interesting that it works OK with Windows XP and Lync 2010 client. Everything else being the same.

    Hi,
    It should popup Outlook interface when you click “View More in Outlook” in Lync client.
    Could you view the conversation history back to a year when you manually check the conversation history on Outlook?
    Please try to use the account to another well worked computer and test if the issue happen.
    Please try to use another Lync account to login Lync and Outlook to test the issue.
    Please also try to disable add-ins about Lync on Outlook and then enable again, restart Lync client and Outlook to test the issue again.
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • Has anyone been able to get a book's internal bookmark hyperlinks working when exporting the book as PDF?

    When a PDF-version of a book is viewed within Preview, bookmark hyperlinks do not work, but they do work on iPad.
    In this support page, Apple states that hyperlinks should work.
    Has anyone got a successful workaround that doesn't involve adding hyperlinks, one by one, via Preview?
    Cheers,
    Tim

    Hi Ken.
    By "Preview", I refer to the Apple Preview app on my iMac; 'Preview' displays the PDF but the hyperlinks within the PDF will not link through to their respective pages throughout the book. Each hyperlink displays underlines, and the 'hyperlink' mouse icon displays when hovering over a hyperlink. It's just that the links won't work. There are hundreds of bookmarks, so adding these manually from within 'Preview' is not a viable option.
    Any thoughts?
    Tim

Maybe you are looking for

  • Do I need to buy a base for Airport to work?

    I acquired my grandmother's iMac that she's had for just under a year and I can't seem to figure out the internet connection. My two roommates and I all have Dell PC's/laptops and use Comcast wireless internet. I'm having trouble connecting with the

  • How to create a layout for  tcode fbl1n

    hi.. i  want to know how to create a layout for flbl1n.pls provide me a step by step approach. regards

  • I can't add my handwrite signature

    From my form I would like sign it but not with ID signature only by handwrite. Acrobat pro XI don' t propose me this option. Thanks for your assistance.

  • Is Unity Web Player safe for my MacBook Pro?

    Is Unity Web Player safe for my MacBook Pro?

  • Macbook Pro case getting VERY hot!

    This is my first Mac, but not my first laptop. Using it for 5 days, the temperature reads out at 85 degrees F. Currently, I am only running iDVD, Firefox, and Microsoft Messenger. The temperature jumped as high as 91 degrees at one point. While doing