I understand that you are telling me not to use hard coded parameters like dx and dy. But logically lastx and lasty will be the last position where the image is, but if I use lastx and lasty in the...
Type: Posts; User: javaguy2020
I understand that you are telling me not to use hard coded parameters like dx and dy. But logically lastx and lasty will be the last position where the image is, but if I use lastx and lasty in the...
Sorry about that. I didn't mean to. I have solved the zoom problem. I am still working on the drag issue. Please see the updated code below:
/*
* To change this template, choose Tools |...
I am not sure which function to change. I am clueless as to where I am wrong.
I am totally for experimentation myself and not spoon feeding but please understand that I am under very tight time constraints and if I dont make it work within little time, I will fail my...
Ok thanks. What can I change in the drawImage function to implement the zoom also?
Thanks again for replying. I tried:
public void mouseDragged(MouseEvent me) {
dx = me.getX();
dy = me.getY();
repaint();
}
I think I tried that but it doesn't seem to work, the image is still jumping. I redraw in the drawImage() function.
Thanks again for replying. I have understood the logic behind the mouseReleased, its just that I am getting nowhere with using my logic. Is it possible for you to tell me what exactly I must write in...
Thank you so much for replying! Can you please tell me what to write in the mouseReleased() function because I have no idea at all and I have been trying to figure out for past few days. What would I...
Please help me or else I will fail this class :(
My problem in the following code is that after dragging the image once, if I try to click on it again and drag it, it jumps once but you can still drag it. I think the problem lies in the...
Sorry for not putting the code tags in as I am new to the forum (still learning :)). Also I think I am having trouble with the mouse listeners. I am perhaps not using the right listener to listen for...
import java.awt.Color;
import java.awt.Container;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.event.MouseEvent;...
Thanks for your interest in solving my issues. I am basically trying to debug the code, I have gotten the idea but I am having trouble having it run properly. As for the task, I am required to build...
Hi everyone! I'm a Java newbie working on a Google Maps type interface where I am trying to pan a preloaded image by using the mouse to drag it around. Also, I am using buttons '+' and '-' to Zoom In...