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

Trending Topics

Online now

Members online
1,105
Guests online
7,866
Total visitors
8,971

Forum statistics

Threads
2,329,466
Posts
29,248,389
Members
1,156,445
Latest member
Laisaaaaa
Back
Top