Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
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!
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
HELP! I need Java! But don't have an earlier version installed! bs2511feist OS X 10 Apr 14, 2011 07:24 PM
Newbie...Firefox Java plugin help needed giarc1234 Mac Applications and Mac App Store 2 Aug 18, 2006 02:24 PM
java programming help (again) phiber optik Mac Programming 24 Apr 28, 2006 07:55 PM
converting dates in java! Please help prostuff1 Mac Programming 9 Apr 7, 2006 10:58 AM
Java Basics Help atif.muhammad Mac Programming 0 Dec 28, 2004 09:41 AM


All times are GMT -5. The time now is 11:04 PM.

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

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