Hello all!

I am trying to create a form like structure using Swing to enter data into MySQL database. I have a combo box that has a list of items to be chosen. If the user does not find the option that he needs, he can choose 'Other' as an option from the combo box. I have given another text field where the user can articulate what his other option is. Now I want to append whatever the user enters in the 'Other' textfield to the combo box list while the user click the save button; thus saving the option in the corresponding table in the database.

Can anyone guide me as to how I can achieve this?

Thanks in advance.

Thankfully,
Nadhi.

Your question is too broad. Which part of the desired operation do you not understand? Do you know how to save data to a database? Do you know how to retrieve values from a UI component? You need to narrow your question a bit, unless you expect someone to write a demo of this entire operation for you, which I would assume is highly unlikely to be done.

Your question is too broad. Which part of the desired operation do you not understand? Do you know how to save data to a database? Do you know how to retrieve values from a UI component? You need to narrow your question a bit, unless you expect someone to write a demo of this entire operation for you, which I would assume is highly unlikely to be done.

Thanks Ezzaral for your reply.
I tried to rephrase my query. It actually clarified the logic behind what I am wanting to do. I am held up with the syntax of implementing it. I will try it. If the code doesn't work, I will get back.

Thank a lot again. I needed a bit of thinking. I did. Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.