Hi, I'm a Freshmen BSIT College Student, Learning Very Basic in JAVA
Can someone help me or give me the code on how to make a box (password field box thingy)
where you can input the password INSIDE the box (that is displayed already)
For Example: (Output)
// The box is displayed already even though there's no yet input from the user __________________________ | | Please Enter your Password | /*this is where you*/ | | /*enter the password*/ | |________________________|
Here is my code snippet (on the log in) anyway: I would like to replace the design
//Username and Password Login do { System.out.print("\n"); System.out.print("\n"); System.out.println("\t xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); System.out.println("\t xx++++++++++++++++++++++++++++++++++++++++++++++++++++++++xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx<> [E][N][T][E][R] [U][S][E][R][N][A][M][E] <>xx"); System.out.println("\t xx<> <>xx"); System.out.print("\t\t\t\t "); username = (br.readLine()); System.out.println("\t xx<> <>xx"); System.out.println("\t xx<>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<>xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx<> [E][N][T][E][R] [P][A][S][S][W][O][R][D] <>xx"); System.out.println("\t xx<> <>xx"); System.out.print("\t\t\t\t "); password = br.readLine(); System.out.println("\t xx<> <>xx"); System.out.println("\t xx++++++++++++++++++++++++++++++++++++++++++++++++++++++++xx"); System.out.println("\t xx<>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<>xx"); //if username and password is correct if(username.equals("123")&&password.equals("321")) { am=3; System.out.println(" "); System.out.println(" "); System.out.println("\t xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); System.out.println("\t xx++++++++++++++++++++++++++++++++++++++++++++++++++++++++xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx<> [L][O][G][I][N] [S][U][C][C][E][S][F][U][L] <>xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx++++++++++++++++++++++++++++++++++++++++++++++++++++++++xx"); System.out.println("\t xx<>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<>xx") }else { int dispattm = attempts - 1; System.out.println(" "); System.out.println(" "); System.out.println("\t xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); System.out.println("\t xx++++++++++++++++++++++++++++++++++++++++++++++++++++++++xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx<> [I][N][V][A][L][I][D] [U][S][E][R][N][A][M][E] <>xx"); System.out.println("\t xx<> [O][R] [P][A][S][S][W][O][R][D] <>xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx<> You have "+dispattm+" attempt(s) left <>xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx++++++++++++++++++++++++++++++++++++++++++++++++++++++++xx"); System.out.println("\t xx<>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<>xx"); attempts--; if(attempts == 0) { System.out.println(" "); System.out.println(" "); System.out.println("\t xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); System.out.println("\t xx++++++++++++++++++++++++++++++++++++++++++++++++++++++++xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx<> Sorry, You have reached the maximum attempts! <>xx"); System.out.println("\t xx<> The program will now exit <>xx"); System.out.println("\t xx<> <>xx"); System.out.println("\t xx++++++++++++++++++++++++++++++++++++++++++++++++++++++++xx"); System.out.println("\t xx<>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<>xx"); break; } } }while(attempts!=3); } }
Thanks in Advance for Help, Sorry I'm new to this forum, I apologize, if I posted this in the wrong forum