Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 29, 2007, 02:14 AM   #1
Sweetlipsof06
macrumors newbie
 
Join Date: Nov 2007
Java MouseListener Help

I'm having issues with implementing MouseListener and MouseMotionListener, it continues to say that MyMouseMotionListener must implement the inherited abstract method MouseMotionListener.mouseDragged(MouseEvent), but as you can see in my code below, I have, thus leading to my confusion. Any Ideas?


import javax.swing.*;
import java.awt.event.*;
import java.awt.*;

public class MouseRectangleAnimation extends JApplet{

int x, y;

public void init(){
addMouseMotionListener(new MyMouseMotionListener());
}

public class MyMouseMotionListener implements MouseMotionListener{

public void mouseMoved(MouseEvent e){
x = e.getX();
y = e.getY();
repaint();
}

public void mouseDragged(MouseEvent e){

}
}
}
Sweetlipsof06 is offline   0 Reply With Quote
Old Nov 29, 2007, 02:31 PM   #2
Sweetlipsof06
Thread Starter
macrumors newbie
 
Join Date: Nov 2007
Strange

Okay, created a new project and the same code worked fine, same settings and everything, don't know why, but it works so I'm happy.
Sweetlipsof06 is offline   0 Reply With Quote
Old Nov 29, 2007, 02:41 PM   #3
SilentPanda
Moderator emeritus
 
SilentPanda's Avatar
 
Join Date: Oct 2002
Location: The Bamboo Forest
Glad it worked out for you. In the future (in this forum and others) try to use the [code] tag around your code (or similar on other forums) as it makes the code retain its format thus insuring all your beautiful spacing and tabbing gets preserved.

public static void main(String[] args) {
if (true) {
System.out.println("hi");
}
}

Code:
public static void main(String[] args) {
     if (true) {
         System.out.println("hi");
     }
}
__________________
My 24 hour web cam! ʕノᴥʔノ ︵ ┻━┻
And remember.
SilentPanda is offline   0 Reply With Quote
Old Nov 29, 2007, 09:58 PM   #4
Sweetlipsof06
Thread Starter
macrumors newbie
 
Join Date: Nov 2007
ooooo [code] tags

aahhhh, ok, srry, kind of a newbie to the forum thing.
Sweetlipsof06 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Some apps prompt to install Java 6 even when Java 7 is installed MacMan988 OS X Mavericks (10.9) 1 Apr 18, 2014 07:56 AM
Java 6 or Java 7 for OSX Mavericks for your Macbook Pro? Starfyre MacBook Pro 3 Dec 22, 2013 03:49 PM
Java 6.x security risk (?) vs Java 7.x and broken apps w/ v7.x installs? mgiamo Mac Basics and Help 1 Dec 15, 2013 03:48 PM
Chrome on OS X -- Java plugin / Java 7 vs Java 6 Issue booyahbooyah Mac Applications and Mac App Store 4 May 31, 2013 09:13 AM
Installed Java 7.07 but doesn't show up in Java preferences? -mattias- OS X 10.8 Mountain Lion 21 Aug 31, 2012 04:49 PM

Forum Jump

All times are GMT -5. The time now is 02:05 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC