Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to make the user input in my command line java app bold

Posted on 2010-09-05
10
Medium Priority
?
791 Views
Last Modified: 2013-11-23
Hi all i was hoping someone could point me in the right direction, how do i make the user input in my java app bold
0
Comment
Question by:awolarczuk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 33606206
It is not possible to put a bold effect on specific text in command line.
0
 
LVL 3

Expert Comment

by:tom_sebastian
ID: 33606517
commandline screen has nothing to do with java. This may be a DOS section question.
Here is the answer:

Yes you can change colors, make bold text etc.. by adding ANSI.sys in config.sys and use some escape sequences.
You can refer the following pages to get an idea about ANSI escape sequences

http://en.wikipedia.org/wiki/ANSI_escape_code
http://www.robvanderwoude.com/ansi.php
0
 
LVL 2

Expert Comment

by:calboronster
ID: 33607640
You could better use a simple swing or applet to behave as a frontend instead of command line.
0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 

Expert Comment

by:rpm_regular
ID: 33607755
its out of scope, because the console is DOS. better use applets to get the effect.
0
 
LVL 2

Expert Comment

by:calboronster
ID: 33613496
The answer to whether DOS command line can be made bold.
The answer is yes and no.

No in the sense that it is not java that will make your command line bold/colorful but DOS command
Yes as in you could invoke dos commands from the java code using JNI or runtime.exec etc.
Use DOS commands like color etc to change highlight and whatever. Messy as it sounds

ALSO all the above makes your code OS dependent.
Alternative cleaner suggestion is to write simple applet that does any magic required, less messier.
With enough objectivity you can separate display logic and functionality and do both above.
0
 

Author Comment

by:awolarczuk
ID: 33616127
hey all sorry i never said anything about DOS i never reread my question, when i am running a java app from a prompt either in windows (yes Dos in windows but in linux as well)
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 33616535
I didn't said anything about DOS, did I? :)

You cannot bring any text effects (or any graphics effect) on command line. You need to use applet for the same.
0
 
LVL 3

Accepted Solution

by:
tom_sebastian earned 2000 total points
ID: 33639382
I didn't said anything about DOS, did I? :)

You cannot bring any text effects (or any graphics effect) on command line. You need to use applet for the same.

 
This is not corect you can use ANSI codes to set the color and graphic effects to DOS commandline.
0
 
LVL 3

Expert Comment

by:tom_sebastian
ID: 33639397
You can provide bat files or sh files with the application jar which will set the OS specific code to set the commandline.
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 33763996
@tom_sebastian: but can you do it to a specific text as the questioner has asked for?

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question