Solved

Very easy question + 200 points.

Posted on 2002-03-03
7
180 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
[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
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
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!

 
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

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

739 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