Strange Problem, JTextField.getText() not working
843806Jun 13 2007 — edited Jun 14 2007Hey folks, I have a JApplet I am working on, building it in Netbeans 5.5.1. I am using the following Swing components for part of the applet:
JTextField jUsernameTextField
JTextField jPasswordTextField
JButton jLoginButton
Here is part of my button release handler:
private void jLoginButtonMouseReleased(java.awt.event.MouseEvent evt) {
System.out.println( "user=(" + jUsernameTextField.getText() + ") pass=(" + jPasswordTextField.getText() + ")" );
}
In the Netbeans IDE when I do a test compile/run it works fine, the username and password are retrieved from the components getText() methods -- when I use the appletviewer that came with my Java install ( jdk1.6.0_01 ) or load the applet via Firefox or MSIE the two textfield getText() methods return an empty string - no exceptions are thrown, nothing in the Java Console to point me to what might be wrong.
Any help would be greatly appreciated, not sure what to look into.
Thanks!
-Andy