To clean console of your command line application,use following code :
/**
* This method clear the current screen
*
*
*/
public static void clearScreen() {
System.out.print("\033[H\033[2J");
System.out.flush();
}
To make bold size of any string,
public void boldSizeOfString()
{
String strNormalSize = "\033[0;0m";
String strBoldSize = "\033[0;1m";
System.out.println (strNormalSize + "My Name is Anthony Gonsalves" + strBoldSize);
}
doesn't work..
ReplyDeleteTry running your Program in Command Line and check if it works or not.
DeleteHi can you explain or link to why it's working.. What is it actually doing?
ReplyDeletebest Regards Jonas
not working
ReplyDeleteI'm using eclipse, it's not working
ReplyDeleteEclipse and other IDEs use TextPanels try to run your program in console/terminal it works perfectly fine :)
DeleteDoes that work in windows?
ReplyDeleteYes after you have compiled your program and execute it from the Windows-Shell it will work
DeleteThanks working
ReplyDeleteCLS working
ReplyDeletehow i clear my console in eclipise ide??
ReplyDelete