Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image mapping in java!!

Status
Not open for further replies.

qb828

Programmer
Sep 27, 2000
98
US
Hi Guys!

I am a little lost and don't know where to start.
My client need a little applet which will map an image.

I know how to map an image in html. But i can't draw a picture of this applet.

Can you help me and kinda tell me what i need to do.

I have a small country map image. How this should work is when i hover around and click over certain region, it should take you to that web site.

It sounds very simple. But I haven't done coding java for a while. I consider myself as little more than beginner.

<img src=&quot;#&quot;myimage.jpg&quot;><map><area shape=&quot;&quot; coords=&quot;> will give me what I need. But i Need to do this in applet.

i also included the image in applet, by getImage(). what it does is it created two images.

Don't I upload the image in java code too or not?

What I want to do is , when i move my mouse over the certain region, i have display certain stats.

can you help me?? thanks.

I guess it is called &quot;hotspot&quot;.
I know that is some certain editors you can use.
I just need to do it with a simple java.


QB
 
>>>>> i also included the image in applet, by getImage(). what it does is it created two images.

This sounds correct, as you have one image in the HTML, and one in the applet ... remove the one in HTML.

>>>> What I want to do is , when i move my mouse over the certain region, i have display certain stats.

This is a little trickier than just adding an image map in HTML and javascript.

Remember that an applet is a Java program running inside a browser, and really has nothing to do with HTML apart from the <applet> tag used to embed the applet. To achive your desired results you will need to employ AWT and maybe some Swing, using classes like MouseMotionListener to detect when a user has the mouse over a certain part of the applet frame. These events will then need to be captured, and then manipulate the captured MouseEvent to determine your desired action (ie displaying data).

Some tutorials and code examples :

The mouse event API docs :
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top