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 6801023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:02:52+00:00 2026-05-26T19:02:52+00:00

I am making a simple chat application and I am trying to find out

  • 0

I am making a simple chat application and I am trying to find out which text component is more appropriate to use.The component will need to support coloured text , provide line wrap and support scroll pane. Also it must allow the user to choose the font thats going to be used ( size , style etc ).

Which is the best option for this ? Thanks .

  • 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-05-26T19:02:52+00:00Added an answer on May 26, 2026 at 7:02 pm

    The JTextArea can do all those things and you might look into the Document interface since this is a chat app. The Document will give you the ability to sync two components like JTextField and JTextArea. Document is not a text field of any kind, but is to be used with one. JTextField has a constructor method for Document “JTextField(Document doc)”. To set the color of you text just call the setForeground(Color) method of JTextArea, also this method is inherited from its parent component JComponent.

    enter image description here

    import javax.swing.*;
    import java.awt.*;
    
    public class Example {
    
        JFrame frameA = new JFrame("Example");
        JTextArea textA = new JTextArea();
    
        public Example() {
            frameA.setSize(600, 300);
            frameA.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Container content = frameA.getContentPane(); // Set the Color of textA.
            textA.setForeground(Color.red);
            content.add(textA);
            frameA.setVisible(true);
        }
    
        public static void main(String[] args) {
            Example exam = new Example();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I making simple silverlight application. I need to access and use an image from
I am making simple application that will take hotel name and price of item,
I am making simple AS3 application that will record audio from microphone and after
I am making a simple chat bot in Python. It has a text file
I'm making a simple tool that will get a string of MySQL commands and
I'm making a simple chat program for me and my friends as a tech
I am making a TCP chat server from a simple tutorial I found and
I am making simple one on server side & one on client side application
I'm making simple C# Winform application. There is a Form having a textbox. I
How to change sizes of ViewController? I'm making simple app which uses deliberately two

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.