Html link inside JLabel

I write this code:
String text ="<html><font size=2>Java-Editor</font>"
+  "<P>"
+ "Homepage: <a href=\"www.b2m.it/ma\"> http://www.b2m.it</a></html>";
JLabel textLabel = new JLabel(text);I show the jlabel inside a jdialog.
When i press on hyperlink, the link don't work
where is the error?

You could use a java.awt.event.MouseListener on the label, it would be something like
public class MyClass extends javax.swing.JFrame implements ajva.awt.event.MouseListener
     // public variables
     public MyClass()
          JLabel label = new JLabel("label text");
          label.addMouseListener(this);
          //other initializations          
     public void mouseClicked(java.awt.event.MouseEvent e)
          //handle click
     //other methods

Similar Messages

  • Adding a html link to JLabel

    Hi...
    So, what I want is a JLabel or maybe a JOptionPane to have a HTML link on it to a website and if the user clicks on said link I would like their default browser to fire up and hit that page. Thus in the below code I have a JLabel with "Java" showing and underlined like it is a link...now, how do I get this event processed?
    JLabel linkLabel =
    new JLabel("<html><a href="+"http://www.java.sun.com"+">Java</html>");
    TIA
    tfm

    search is your friend:
    http://search.java.sun.com/search/java/index.jsp?col=javaforums&qp=%2Bforum%3A31&qt=hyperlink+label

  • How Do I Make HTML Links Open in Same Window?

    Hi
    How on earth do I get the HTML links inside a flash movie open up in the same browser window where said movie is embedded in (As opposed to opening up as a new pop-up windows)? Here is the code I have inside each of the buttons I have inside my flash movie:
    var link7:URLRequest=new URLRequest("videos/december.html");
    videos_btn.addEventListener(MouseEvent.CLICK, buttonClicked7);
    function buttonClicked7(event:MouseEvent):void
    navigateToURL(link7);

    Thank you thank you thank you!!!

  • HTML Link -AS2 fine, AS3 weird behaviour

    Hi Guys, I'm working on a project at the moment, and am
    seeing weird behaviour with the way my swf handles html links
    inside dynamic textboxes. When rendered as a AS2 file, the link
    works on a release as expected. When its inside a AS3 file the link
    will only work if the user right click and chooses 'open in new
    window' was there a change in behaviour how AS3 handles these
    links, or is there now an declaration needed to be made to allow
    these link to have the old behaviour?
    The project calls for xml data and embedded in that is a html
    link. Originally I thought it might have been the way I'd formed
    the xml so I tried with a hardcoded version instead (dynamic
    textbox, add text -> highlight -> add link through properties
    tab). But I still see the same behaviour between the as2 and as3
    versions.
    Any help would be greatly appreciated.
    Cheers.

    Actually, the ''href'' attribute is supposed to direct the browser to a new URL, etc., not run a script. Instead, use the ''onclick'' event attribute:
    ''<a onclick = “$('.div-feedback').fadeIn();”></a>''.
    Happy coding!

  • Mailto links inside html widget

    Did anyone successfully inserted a mailto link inside an html widget?
    I tried this <a href="mailto:[email protected]">Send mail</a> but nothing happens when I click it on the ipad, any idea ?
    Thanks.

    I looked inside a ibook author file after putting in a keynote with the mailto link that worked on the ipad. Inside the folder there is a *.JSON file that lists the mailto as follows:
    "hyperlinks":[{"url":"mailto:put%2520email%2520here?subject=Notes"
    ie- I left the email link as "put email here" and the slide is called Notes
    I am not sure if the formatting of the mailto is also an issue or the fact that it is in a JSON..

  • Open an html file inside spry collapsible panel

    Greetings,
    Using CS5
    Does anyone know the CSS code/possibility of opening an html file inside the Spry panel?
    I've tried the following code:
    .CollapsiblePanelContent {
        background-image: url(lookoutgraph.html);
    Is there a better CSS element for calling up an html file?
    For what it's worth...the html file I'm tring to open uses a <canvas> tag. When opened by itself, the html file has no problem opening and displaying the canvas data.
    Much Thanks!

    With the exeption of images, to add external content to a document you will need to make use of either serverside or clientside code.
    Have a look at the SpryHTMLPanel here http://labs.adobe.com/technologies/spry/samples/htmlpanel/html_panel_sample.html
    Otherwise, please supply a link to your site so that we can come up with alternatives.
    Gramps

  • Can you force a link inside a .pdf to open the "linked to" document in a new window?

    When I have a link inside my .pdf document - linking to another .pdf document or to a Word document - how can I force the linked-to document to open in a new window?
    I have a web site (business internal, so unfortunately I cannot point to it).  My HTML menu has links to .pdf documents - no problem.  However, once I open those .pdfs, they contain links to other .pdfs and to Word documents.  Clicking on these links, which reside inside my .pdfs, opens the "linked-to" docs in the same page.  How can I force them to open in a brand new frame?
    All of my .pdfs were originally created in Word, and in the Word versions, the links DO open into new frames.  I am not sure why, when I convert them to .pdfs, they lose this feature.
    Can anyone help?

    Hi Magenta,
    Would you mind reposting this question over on the Acrobat boards?  You've posted in the AIR forum and you'll have better luck with this over there.
    Thanks,
    Chris

  • Broken Links inside FLash

    I notived that the links inside my flash header do not work
    on this page as well as other pages inside this directory. The
    links do work in the root directory. Does someone know how to fix
    this problem I am having? Here is the link:
    http://www.school-psychologist.com/nick/worshipping/creative.html
    The action script URL setting is index.html, about.html, etc.
    For some reason when you click the following link, the flash header
    sends the user to
    http://www.school-psychologist.com/nick/worshipping/index.html
    instead of
    http://www.school-psychologist.com/nick/index.html
    Thanks a bunch!!

    impossible to say other then your code is wrong - always
    always always copy/paste the code in
    question or we have nothing to go by - but flash simply does
    not replace urls with other urls - you
    must have the wrong code on the wrong button and missed
    something simple.
    --> **Adobe Certified Expert**
    --> www.mudbubble.com
    --> www.keyframer.com
    Mike Splat wrote:
    >
    >
    > I notived that the links inside my flash header do not
    work on this page as
    > well as other pages inside this directory. The links do
    work in the root
    > directory. Does someone know how to fix this problem I
    am having? Here is the
    > link:
    >
    >
    http://www.school-psychologist.com/nick/worshipping/creative.html
    >
    > The action script URL setting is index.html, about.html,
    etc. For some reason
    > when you click the following link, the flash header
    sends the user to
    >
    http://www.school-psychologist.com/nick/worshipping/index.html
    instead of
    >
    http://www.school-psychologist.com/nick/index.html
    >
    > Thanks a bunch!!
    >

  • Loader disabling HTML links on page

    I've designed a slide show player using Actionscript 3.0 which loads several external images. While the images are loading, the HTML links on my page (outside of the Flash movie) don't work. As soon as all the images are loaded, the links start working again. It seems like the Flash player is hijacking the browser while the images are loading which can take the better part of a minute depending on my connection speed. I can click an HTML link once during the loading time and as soon as the images have loaded, the browser loads the new page (the one the HTML links to). Once all the images are in my Temporary Internet Files folder, this problem ceases to exist (since the images no longer need to be downloaded). It's only first-time viewers that will have this problem, but it's a pretty major problem.
    Any advice would be greatly appreciated.
    Joe          

    I got a suggestion on the Dreamweaver Forum:
    "...You could write some code inside the Flash item, that detects bandwidth and only loads images with delay, when the connection is idle. I'm sure you can find enough examples of such behaviors in pre-loader samples of any kind and some of it is already pre-defined in later versions of Flash..."
    Can anyone tell me how to write this code or point me to some examples that use it?
    Joe

  • Links inside pages built on Templates

    Does anyone have any info on putting links inside an editable
    region of a page constructed from a template. The links work fine
    if I take them out and put on a normal page but not insde the
    template based page. Is there a way around this.
    If anyone could help it would be much appreciated.
    Catherine

    Catherine: You are mistaken. Being in or out of a template
    would have no
    effect on DW's ability to maintain the links (as long as the
    links are
    plainly visible in the HTML).
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "catherineanselmi" <[email protected]> wrote
    in message
    news:eh689c$qrp$[email protected]..
    > Does anyone have any info on putting links inside an
    editable region of a
    > page
    > constructed from a template. The links work fine if I
    take them out and
    > put on
    > a normal page but not insde the template based page. Is
    there a way around
    > this.
    > If anyone could help it would be much appreciated.
    > Catherine
    >

  • Auto-select field after clicking link inside Appearance panel

    Before Illustrator CC 2014, when I clicked on a link inside the appearance window, the corresponding field would auto select. This made for a more efficient workflow. But now for some reason this has disappeared and I miss it! Hey Illustrator team, can you guys add it back in the next release?
    How to reproduce:
    Click on Opacity in the Appearance panel > "mini" opacity panel opens.
    Opacity field should be selected so all the user has to do is click up or down arrows on their keyboard.
    Just something small I noticed after I upgraded to CC 2014. Not a big deal honestly, but a small regression.

    You might try the steps in this Knowledge Base article;
    http://docs.info.apple.com/article.html?artnum=304482
    Dah•veed

  • How to open a link inside shell.

    There are workset items in ux3.shell in ui5. I have given a http link in setContent method of one of the worksetitem. This link is opening but in new window and not inside the shell. But i want to open that link inside the shell.

    JS Bin - Collaborative JavaScript Debugging
    mContent[id] = new sap.ui.core.HTML({content : " <iframe id='myExternalLink' style='width:100%;height:100%;z-index:-1' width='100%' height='100%' src='http://go.sap.com/index.html'></iframe>" });

  • Is It possible to load Html page inside Adobe Flash...?

    Hi Everyone!
    Is It possible to load Html page Inside Adobe Flash CS5.
    Any help would be a great help...!
    Originally, i wanted to bring in through <IFRAME> but i don't see that flash understands that.
    Thanks in advance!
    -yajiv

    Not exactly sure how you where planning to display that HTML content in relation to the overall page, but given the limitations of Flash... that may just not be possible...
    But, it would be a simple matter to display an HTML iframe over the top of or behind a Flash .swf... So while the iframe would not be a part of the .swf, it certainly could be designed to make it look as though it were.
    Controling the stacking order or layering of content on a Web page is accomplished through z-indexing. Correctly positioned and z-indexed, the iframe could apear over the top of the .swf... the .swf in effect being the background... OR the iframe could appear behind the .swf and with a transparent section in the .swf, the iframe would appear through that hole. If there is navigation or links in the iframe, they will be blocked by the .swf though.
    http://www.w3schools.com/cssref/pr_pos_z-index.asp
    But this may be an option....
    Best wishes,
    Adninjastrator

  • html:link action="" input type="button"... does not work under IE browser

    Greeting,
    I have the following codes in struts1.3.5. It works fine under Firefox, but it does not work at all under Internet Explore (IT) at all. Any clues why under IE it does not work?
    <html:link action="/private/search">
    <input
    type="button"
    value="Search"
    class="search-button">
    </html:link>
    Thanks a lot!

    This would probably generate a HTML in which there will be a button inside anchor tag.
    This is not a standard HTML feature and no wonder this is not supported by IE. I copied the generated html codes into test.html to try on IE, the button does not work at all.
    Firefox is probably lenient here. True. test.html works in Firefox.
    You might want to just have a link or do a form submission on button click.The action designed does not need an actionForm. I updated my code to :<html:button onclick="location.href='processSearch'"
    property ="Search"
    value ="Search">
    </html:button>
    And now both Firefox & IE works fine.
    Thanks a lot!

  • HTML link in column ... Need Help!!!!!

    I need to use a column in my viewobject to create an html link to an external resource on another server, a simple webpage. I've used the RowImpl for my view object to build the HREF but when the rows are rendered the link is fully escaped and isn't a working link. I need to have this link enabled by 2pm today and I'm totally "stuck on stupid" trying to get it to work. Any help, and fast, would be hugely appreciated!
    Thanks!!
    scott

    Is your RowImpl building just an URL, or is it building
    the full bit of HTML, like "<a href='....'>some text</a>"?
    If it's just building just an URL, you want to use
    something like:
      <link text="Whatever text you need">
        <boundAttribute name="destination">
          <bc4j:attrValue name="hrefAttr"/>
        </boundAttribute>
      </link>If your VO is building the whole bit of HTML, then
    go with <formattedText>:
      <formattedText>
        <boundAttribute name="text">
          <bc4j:attrValue name="hrefAttr"/>
        </boundAttribute>
      </formattedText>If your HTML is really funky (or you're using JDev
    9.0.2), you may need to substitute <rawText>
    for <formattedText>.
    In both of these cases, the snippet of code belongs
    inside the right <bc4j:viewObjectScope>, and the
    "name" on that <bc4j:attrValue> is the attribute in
    your row that contains the href you're generating.

Maybe you are looking for

  • I transferred video from iPhone (4S) to iPhoto and then to iMovie9.  Footage in iMovie is stretched.  Is there a way to fix that?

    I transferred video from iPhone (4S) to iPhoto and then dropped that footage into iMovie9.  The footage is there in iMovie but it is stretched.  I have tried to adjust using aspect ratio options but that doesn't work.  Is there a way to fix that in i

  • Showing Group Results

    I have a group above report that is 3 levels deep (a)Group --(b)Rep ----(c)Orders Group a and group b will always have data returned. Group c however may or may not have data returned based on the query. I would like to supress group b if group c doe

  • Get ClientContext from Full sharepoint url?

    I am receiving a full sharepoint url like 'http://TestServer/sites/TestSite/TestSubSite/_vti_bin/lists.asmx' I know the following code will not work as the url does not directly reference a site. using (var context = new ClientContext(http://TestServ

  • Mac Mail - Add Account Options

    My mac mail will not give me "account type" options. How do I get the option to select an account type. When I go to preferences and click on the "+" button to add an account I just get the screen that says enter your name email address and password.

  • Adobe Story memory leak

    I am running Adobe Story online in Windows 7 Ultimate, 64-bit, using the application on my desktop. In the Task Manager, the Memory for Adobe Story constantly increases. At the moment it's 160,000 KB and climbing. If I leave it open for any length of