Wednesday, September 7, 2011

Java HMTL-like Imagemap

How many of you ever wanted to use an imagemap in Java (awt - swingx)?, well all you need to do is download the code from github and you need to make an image for each element of the imagemap and put the region or element in the place that you want it to appear, It's easier if you open the whole image in photoshop or gimp, and just start to create layers for each region, and save each layer in a different file, like this:



A tooltip shows you in which region the pointer is, you just need to add a click event listener to get the id of the region that was clicked: