java - Display text only for a couple seconds -


i have made simple register , login page. after user registered or logged in, message display result.

this working fine, want text displayed couple seconds. after 5 seconds text gone.

        int = ps.executeupdate();         if (i > 0) {             out.print("successfully logged in...");             requestdispatcher rs =    request.getrequestdispatcher("/loggedin.html");             rs.include(request, response);         } 

i've searched online, can't find on how it. tips / comments welcome!

to delete you've printed print backspace character \b.

so fit needs:

string s = "successfully logged in..."; // better use system.out.print() out.print() * system.out.print(s);   thread.sleep(2000); // wait 2 seconds  // print backspaces charactes printed using commonlangs stringutils.repeat("\b", s.length);      // print backspaces charactes printed loop (i = 0; < s.length; i++) {     system.out.print("\b"); } 

note: doesn't work nice in eclipse console. works perfect in command console. see how backspace \b work in eclipse's console?

* better use system.out.print() out.print()


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -