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

  • SEARCH
  • Home
  • 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 6588527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:03:34+00:00 2026-05-25T17:03:34+00:00

After writing a console application (For mundane I/O tasks not worth mentioning here), I

  • 0

After writing a console application (For mundane I/O tasks not worth mentioning here), I decided I needed to make the text multicolored for readability. I would’ve liked to keep it in a command prompt, being inexperienced with Swing, but as far as I could figure there was no way to do that, I looked around the Swing API and can’t find anything.

Ideally, I’d be able to use something like

for(int i=0; i<aString.length(); i++){
    if(aString.charAt(i) == '?'){
        String pre = aString.substring(0,i);
        String post = aString.substring(i);
        aString = pre + red("?") + post;    //As you can see by red("?"), I have no idea what I'm doing
    }
}

so that I could just loop through the text I would have previously printed, insert the coloring information, and display it.

Can anyone point me in the right direction? Method, class, snippet, anything?

  • 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-25T17:03:34+00:00Added an answer on May 25, 2026 at 5:03 pm

    I would’ve liked to keep it in a command prompt, being inexperienced with Swing

    You might get some ideas from Message Console.

    enter image description here

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

Sidebar

Related Questions

I'm writing a tic tac toe program that plays throuh the terminal/console After Player
I'm writing an application that displays Google Map right after the login screen. The
I'm writing a web application which contains a kind of schedule. After a certain
In a small console application I'm writing to test something I need to add
I'm writing a console application which is looking up information about SSIS packages in
I want to make something like history of commands for my console-application. It does
I am writing a Console application using C#, in which I am firing Print
I am writing a simple console application in LInux/C++ that accepts user input from
I'm writing C++ console programs. After compilation, when I run the program from my
I am writing a simple console application to read 3 words and keep them

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.