🔒 Closed Please help !! :'( about java basic lang to...

Status
Not open for further replies.

Princess Serrano

Honorary Poster
Gusto ko po mag clearscreen, gusto ko din mag timeout at gusto ko magkakulay yung text output ko sa cmd.

For example

class Sample{
public static void main ( String [] args ) {
//wait(1000);
System.out.println("Hello World!"); //color yellow
//cls or clear the
}
}
 
Pwede ka gumamit ng timertask para madelay ung call mo ng println.
Ex.
import java.util.Timer;
import java.util.TimerTask;

Timer myTimer;

void startTimer(int seconds){
myTimer = new Timer();
myTimer.schedule(new myTimerTask() , seconds*1000);
}

class myTimerTask extends TimerTask{
.public void run(){
// dito mo lagay method mo pag times up na.
myTimer.cancel();
}
}
Para maging yellow ung txt sa cosole mo gamit ka ng ANSI escape codes.
Ex.
public static final String RESET = "\u001B[0m";
public static final String YELLOW = "\u001B[33m";
Then
System.out.println(ANSI_RED + "This is YELLOW!" + ANSI_RESET);
Magpprint ng yellow yan kung supported ung terminal mo.
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 661
    Views
  • 3
    Participants
Last reply from:
Raizenn

Online now

Members online
1,054
Guests online
1,054
Total visitors
2,108

Forum statistics

Threads
2,275,670
Posts
28,964,688
Members
1,231,899
Latest member
jeron05
Back
Top