I'm assuming you're talking about AWT or Swing.
You'll need to setup a button listener for the sumbit button, and when that button is clicked you can use passwordTextbox.getText(); to get the text out of the box. Check the Java API, there's a bunch of tutorials on this.
http://java.sun.com/j2se/1.5.0/docs/api/ here ya go.