Results 1 to 2 of 2

Thread: Html hr color

  1. #1
    newbie123 is offline Member
    Join Date
    Nov 2009
    Posts
    90
    Rep Power
    0

    Question Html hr color

    I am trying to draw a horizontal line in a JLabel using HTML's HR (horizontal rule) element. It works fine, but the color attribute (COLOR=BLUE) doesn't seem to work.

    Here's the line of HTML:

    <hr noshade size=2 width=50 color=blue align=center>

    Any ideas why this doesn't work with respect to color? All the other attributes work just fine.

    Is there a better way in Java to draw a horizontal line in a JLabel?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,196
    Rep Power
    19

    Default

    It's an old issue. One possible solution is given here
    Swing - Problem with HTML in a JLabel

    Note: Please don't post in that old thread, it's been dead for 3 years.

    Incidentally, I see the align attribute doesn't work either.

    db

Similar Threads

  1. if (...) ... won't set color
    By livingdog in forum New To Java
    Replies: 6
    Last Post: 04-11-2010, 03:59 PM
  2. RGB from Color Name
    By winklerd in forum Advanced Java
    Replies: 5
    Last Post: 03-26-2010, 05:16 PM
  3. [COLOR="Navy"]execute .bat file in mysql [/COLOR]
    By msankar.ravi in forum Networking
    Replies: 0
    Last Post: 02-24-2010, 04:27 AM
  4. How can I include a html file in html textarea?
    By surya_dks in forum New To Java
    Replies: 2
    Last Post: 10-04-2008, 07:20 AM
  5. A bit of color!
    By tim in forum Java 2D
    Replies: 8
    Last Post: 02-11-2008, 11:57 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
  •