Results 1 to 2 of 2
  1. #1
    leonard is offline Member
    Join Date
    Jul 2007
    Posts
    43
    Rep Power
    0

    Default How to use JLabel with html

    I have to open some html page.
    this is my code

    Java Code:
    oblab = new JLabel("<html><a href=C:\\Documents and Settings\\Allusers\\
    My Documents\\d.html>hello</a></html>");
    I want to open html file in browser when I click on JLabel, but it doesn't work
    what's the problem?

  2. #2
    gabriel is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default

    you cannot link to a html page and make it open when you click a button .. you will need to implement the action listener and open browser to display (render) html in your application.

Similar Threads

  1. JLabel append?
    By Jononomous in forum New To Java
    Replies: 0
    Last Post: 04-07-2008, 07:41 PM
  2. Including HTML in a JLabel
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-27-2007, 09:56 AM
  3. help me with JFrame and JLabel
    By michcio in forum New To Java
    Replies: 5
    Last Post: 11-20-2007, 07:44 AM
  4. JLabel
    By Jack in forum AWT / Swing
    Replies: 2
    Last Post: 07-02-2007, 01:55 PM
  5. JLabel
    By Freddie in forum AWT / Swing
    Replies: 2
    Last Post: 05-29-2007, 02:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •