which one, in java you have to make applets that go on websites.
you then load the applets.. I dont really know how to use java, or make it,

but if your talking about javascript, then its simple

<script>
var vv=prompt('hello, whats the password?');
alert (vv);
</script>

this isnt pw protection, by all means no...
but this is how you get the input box and message box up....