🔒 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
  • 694
    Views
  • 3
    Participants
Last reply from:
Raizenn

Online now

Members online
426
Guests online
3,390
Total visitors
3,816

Forum statistics

Threads
2,348,686
Posts
29,358,398
Members
1,094,665
Latest member
Mtsqf
Back
Top