Solved

MouseOver applet

Posted on 1997-06-23
1
413 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 64
egit plugin on eclipse 8 96
how to debug htl and js pages 8 53
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 40
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

740 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