This site requires JavaScript, please enable it in your browser!
Greenfoot back
Entity1037
Entity1037 wrote ...

2013/9/29

Create a pop-up that asks for a password before proceding?

Entity1037 Entity1037

2013/9/29

#
I want to show my friend my "Megaman EX Alpha 3" scenario I'm working on, but I don't want to show it to other people. How do I create a pop-up that requires you to enter a password to play the scenario, or else it will go to a black screen (effectively rendering the game unusable)?
Entity1037 Entity1037

2013/9/29

#
Also, the screen will turn black via "FadeOverlay.class". So you just need to call it's "fadeOut()" method (it starts visible anyway, but doing this will cause it to immediately stop fading, and increase its opacity).
JetLennit JetLennit

2013/9/29

#
1st you must import import javax.swing.JOptionPane; 2nd you do something like this
if(JOptionPane.showInputDialog(null, "What is the password").equals("The Password"))
{
      Continue
}
It is funny... I was just working on a password protection program
You need to login to post a reply.