mouse motion

A

Alan

Hi guys..

I keep getting this error, and I cannot figure out whats going
on..i have used the same code it the other program and it worked
perfectly..i have no idea why is it doing this now...can you please
help me...just a beginner

error:

C:\Documents and Settings\Default\Desktop\cs335\PROJECT 3>javac
app.java.\DrawPanel.java:26: <anonymous DrawPanel$1> should be
declared abstract; it does not define
mouseDragged(java.awt.event.MouseEvent) in
public void mouseMoved(MouseEvent
event)

this is my code>>

DrawPanel()
{
addMouseMotionListener(
new MouseMotionListener()
{
public void mouseDragged(MouseEvent event)
{
xVal = event.getX();
yVal = event.getY();

}
}
);

addMouseListener(
new MouseAdapter()
{
public void mousePressed(MouseEvent event)
{

xVal=event.getX();
yVal=event.getY();

coordinates();

} } );


}
 
V

VisionSet

Alan said:
Hi guys..

I keep getting this error, and I cannot figure out whats going
on..i have used the same code it the other program and it worked
perfectly..i have no idea why is it doing this now...can you please
help me...just a beginner

error:

C:\Documents and Settings\Default\Desktop\cs335\PROJECT 3>javac
app.java.\DrawPanel.java:26: <anonymous DrawPanel$1> should be
declared abstract; it does not define
mouseDragged(java.awt.event.MouseEvent) in
public void mouseMoved(MouseEvent
event)

this is my code>>

DrawPanel()
{
addMouseMotionListener(
new MouseMotionListener()
{
public void mouseDragged(MouseEvent event)
{
xVal = event.getX();
yVal = event.getY();

}
}
);

addMouseListener(
new MouseAdapter()
{
public void mousePressed(MouseEvent event)
{

xVal=event.getX();
yVal=event.getY();

coordinates();

} } );


}

new MouseMotionListener()

change for:

new MouseMotionAdapter()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top