How to have a jLabel update its values automatically from the values in a jTextField.This article will describe how to update the jLabel from the jTextfield values automatically along with example source code.
Assume that you have a jLabel called jLabel3 and a jTextfield called jTextField1
Here is the source code to be used.The keyReleased event of the jTextField will be used.
private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) { jLabel3.setText(jTextField1.getText()); }
That is all.
If you liked this article please do leave a reply and share it with friends.
Thanks.