Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Password Program
#1
This program will ask the person for a password and if they get it right the will be shown some info. Fully commented!
[code2=java]import javax.swing.JOptionPane;
public class password {

public static void password (){
String password = "Potato";//This is the actual password
String input = (JOptionPane.showInputDialog("Insert Password:"));// This is the question asked

if (input.equals(password)){
JOptionPane.showMessageDialog(null, "Access Granted");//If you get it right
JOptionPane.showMessageDialog(null, "This is the information:BLAH BLAH BLAH BLAH BLAH BLAH");//The information

}else{
JOptionPane.showMessageDialog(null, "Access Denied");//If you get it wrong nothing happens
}
}[/code2]

p.s. The password right now is Potato


Messages In This Thread
Password Program - by WitherSlayer - 01-09-2013, 08:26 PM
Re: Password Program - by andrei.xd23 - 05-07-2013, 07:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PIN Program WitherSlayer 0 7,134 01-09-2013, 08:37 PM
Last Post: WitherSlayer

Forum Jump:


Users browsing this thread: 1 Guest(s)