Java: Clear the console

后端 未结 14 2990
青春惊慌失措
青春惊慌失措 2020-11-21 23:26

Can any body please tell me what code is used for clear screen in Java? For example in C++

system(\"CLS\");

What code is used in Java for

14条回答
  •  长发绾君心
    2020-11-22 00:15

    You need to use JNI.

    First of all use create a .dll using visual studio, that call system("cls"). After that use JNI to use this DDL.

    I found this article that is nice:

    http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=5170&lngWId=2

提交回复
热议问题