Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8142293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:46:07+00:00 2026-06-06T12:46:07+00:00

Okay so I figured out the whole color business using HTML, but now when

  • 0

Okay so I figured out the whole color business using HTML, but now when I put it in my Jlabel its not working! Might it have anything to do with the fact that i am using getText() from a TextArea to set the text of my Jlabel? Here’s my code:

String air = "<html>\n" +
            "<ul><font color=blue>blue</font>\n" +
            "</ul>\n";

…

JLabel jl = new JLabel();
jl.setSize(700,700);
frame.add(jl);
jl.setText(environment.getText());

I get this….

<html><ul><font color=blue> text </font></ul>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:46:09+00:00Added an answer on June 6, 2026 at 12:46 pm

    I tried your code and it’s work properly.
    Can you post complete code ? Are you running java applet ?
    I found similar issue in here : HTML no longer working in JLabel (and other components).
    Hope it’s can help you.

    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextArea;
    
    public class JLabelSample extends JFrame {
    
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    
    public static void main(String[] args) {
    
        JFrame frame = new JLabelSample();
        frame.setVisible(true);
        frame.setSize(400, 400);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        String air = "<html>\n" + "<ul><font color=blue>blue</font>\n"
                + "</ul>\n";
        JTextArea area = new JTextArea(air);
    
        frame.add(area);
    
        JLabel jl = new JLabel();
        jl.setSize(100, 100);
        frame.add(jl);
    
        jl.setText(area.getText());
    
    }
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so I've figured out how to get my external ip using wget: wget
Okay, next PHPExcel question. I have an HTML form that users fill out and
Okay I almost have this rebase thing figured out. I can feel a breakthrough
Okay I just typed this whole question out and then managed to delete it.
Okay, so the answer to my question might not be the problem but here's
Okay so part two on this. I restructured the code on this but now
Okay I've been trying to figure this out for a while now. I have
Okay, this has been absolutely infuriating to debug, I have finally figured out what
Okay, I know I'm doing something wrong - but can't figure out a better
Okay, I'm kinda stuck on really silly problem, but still can't figure out. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.