Question: write java code Assume that you have created a jLabel with the name employeeName, two jTextFields with the name firstName_TF and lastName_TF, and a jButton

write java code

Assume that you have created a jLabel with the name "employeeName", two jTextFields with the name "firstName_TF" and "lastName_TF", and a jButton with the name "addBtn". You also have a combo box with the name "title_CB" that has "Mr." in the first option and "Mrs." in the second option.

When the button is clicked, get the text iwritten in "firstName_TF" and "lastName_TF". Depending on the selection of the title_CB, display them in the "employeeName" label as follows:

If the title is the first selection

Mr Last name, first name.

If the title is the second selection

Mrs Last name, first name.

Write the code for this button handler.


Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!