Solved

Very easy question + 200 points.

Posted on 2002-03-03
7
165 Views
Last Modified: 2011-09-20
Hi


I need to see an applet that does the following please:
display an image.
allows me to drag it up, down, left, and right.

I want you to identify which commands in the code that allows me to drag the image.
Thanks alot
0
Comment
Question by:aja101498
7 Comments
 
LVL 3

Expert Comment

by:daitt
ID: 6838325
Sounds like a homework question.
Build an applet. In start() function, load the image. In paint(Graphics g) function, draw the image.
Catch mouseDown(MouseEvent e), mouseUp(MouseEvent e), mouseDragged(MouseEvent e) to change the coordinate of the image, and repaint.
If you have problem with any of the things below, please ask.
0
 

Author Comment

by:aja101498
ID: 6839247
No I am not student I am start learning Java and I couldn't find this in box.
All I want is to see an example. Thanks
0
 
LVL 3

Expert Comment

by:daitt
ID: 6840347
Please try to build the applet step by step. I think this is a good way to learn java.
1. Create an empty applet, test it.
2. Load the image (in init() function of the applet) and display it (in paint function of the applet). Test the applet.
3. Catch onMouseDown and onMouseDragged to move the image. Test the applet.
4. Catch onMouseExited to reset mouse status when user move out of the applet. Test the applet.

You can ask if you have any problem with the steps above.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Accepted Solution

by:
sanjay_thakur earned 200 total points
ID: 6840356
0
 
LVL 8

Expert Comment

by:Exceter
ID: 7384860
Pardon our critisism but you must understand that we have many students that attempt to get us to do their homework for them.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8658254
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to sanjay_thakur

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now