Add Word to TextField with Button | Java Swing

 


Add Word to TextField with Button | Java Swing

________________________________________________

1.Make project like this:










2.Code for "Hello", "Java", "Welcome", "Programming" buttons:

private void btnHelloActionPerformed(java.awt.event.ActionEvent evt) { txtWord.setText("Hello"); } private void btnJavaActionPerformed(java.awt.event.ActionEvent evt) { txtWord.setText("Java"); } private void btnWelcomeActionPerformed(java.awt.event.ActionEvent evt) { txtWord.setText("Welcome"); } private void btnProgrammingActionPerformed(java.awt.event.ActionEvent evt) { txtWord.setText("Programming"); }

_____________________________________________


Dark Hers

https://darkhers.blogspot.com

YouTube

https://youtube.com/@darkhers

Instagram

https://instagram.com/darkhers

Facebook

https://www.facebook.com/darkhers

TikTok

https://www.tiktok.com/@darkhers

Pinterest

https://www.pinterest.co.uk/darkhers

Twitter

https://twitter.com/Dark_Hers

Comments

Popular Posts