Solved

MouseOver applet

Posted on 1997-06-23
1
415 Views
Last Modified: 2011-10-03
I am asking this question again, because I might not have been clear enough the first time. I am looking for code that will change an image/picture to another picture when the mouse enters the area of the picture. The picture should change back after the mouse leaves the area. Also, the images need to be linked to a different URL site. Please help!!
0
Comment
Question by:pinto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
webster030697 earned 100 total points
ID: 1221983
Do you want to change the whole image, or parts of an image? Either way the code I gave you has all the functionality you require. Just change the mouseMove() and paintApplet() methods to draw a new image, rather than red ovals.

As for linking to URLs, this is easy. You need a mouseDown() method:

public boolean mouseDown(Event evt, int x, int y)
{   if (area.inside(x, y))
    {   getAppletContext().showDocument(url);
        return true;
    }
    else
        return super.mouseDown(evt, x, y);
}

Where area is a Rectangle of pre-determined coordinates, and url is the URL you want to jump to.

If you build on the logic I gave you in the MouseMotion applet, you can generate an image map, where different parts of an image go to different URLs.

It might help to check out some of the on-line courses available, and buy a book. I've responded to your other question about this.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question