Search code examples
javauser-interfacedrop-down-menucountryjform

Implementing a Drop Down Menu with a Country List into a JavaForm


So, I was wondering how I would go about implementing a list of all the countries in the world, into my JavaForm.

As I don't want to sit and write out all the countries in the world, I would like to implement a outside list, but I can't find anywhere where I can actually find out how to implement a drop down list like this:

https://i.sstatic.net/zdaEk.jpg

I came here therefore looking for some help. This is what my current GUI looks like, and then I would like a drop down menu to be beneath the country panel.


Solution

  • You can implement this class and retrieve all the countries in the world. I also recommend you to use a auto suggestor in the country textfield.