Solved

Very easy question + 200 points.

Posted on 2002-03-03
7
167 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse compiler vs Installed JREs option 3 77
Java and GPO 11 70
how do i compare an object based on two fields 6 49
object oriented programming comparison 5 55
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

920 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

12 Experts available now in Live!

Get 1:1 Help Now