Search code examples
javagoogle-mapsuser-interfacejtextfield

How to incorporate google maps into java gui?


My idea is to put google maps in my java gui. I would like to have a jtextfield to write the place where I want to go and than an image appears in the gui with the location desired. I have no idea how to do this. I don't even know if it is possible. It does not have to be google maps but some other maps software that does the same thing. I have done some research but I haven't found something understandable. Do you have any suggestions? Thank you


Solution

  • As far as I know, you cannot use Google Maps in your java GUI. Google Maps have javascript API. There is something you can do. If you do not intend to use, all the Google Maps functions (zoom and so on,..) I suggest you use Google Static Maps. What it does is, you send an URL request, which returns you the picture.

    Or you could embed a web browser control into your GUI, displaying the page that uses the javascript API for Google Maps.

    I know that this probably isn't what you are looking, but I think it's still worth checking it out.

    Google Static Maps link