Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 800
  • Last Modified:

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

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
awolarczuk
Asked:
awolarczuk
  • 3
  • 3
  • 2
  • +2
1 Solution
 
Gurvinder Pal SinghCommented:
It is not possible to put a bold effect on specific text in command line.
0
 
tom_sebastianCommented:
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
 
calboronsterCommented:
You could better use a simple swing or applet to behave as a frontend instead of command line.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rpm_regularCommented:
its out of scope, because the console is DOS. better use applets to get the effect.
0
 
calboronsterCommented:
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
 
awolarczukAuthor Commented:
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
 
Gurvinder Pal SinghCommented:
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
 
tom_sebastianCommented:
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
 
tom_sebastianCommented:
You can provide bat files or sh files with the application jar which will set the OS specific code to set the commandline.
0
 
Gurvinder Pal SinghCommented:
@tom_sebastian: but can you do it to a specific text as the questioner has asked for?

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now