Ok, working on a simple applet for a class at uni (basically following a step by step) and I can't work out what's wrong. The applet is ment to change the colour of a box when the mouse is clicked, which I can do fine, it's just the start that's buggered me.
This is what I've got, I only added in the "implements MouseListener" and "addMouseListener(this);" parts.
When I compile it I get an error on the "public class HelloWorld extends Applet implements MouseListener{" line, saying:
HelloWorld is not abstract and does not override abstract method mouseReleased(java.awt.event.MouseEvent) in java.awt.event.MouseListener
And I've got no idea what that means. Any help?
This is what I've got, I only added in the "implements MouseListener" and "addMouseListener(this);" parts.
Code:
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class HelloWorld extends Applet implements MouseListener{
private String message = "Hello World!";
public void init() {
addMouseListener(this);
}
public void paint(Graphics g) {
(other stuff goes here, which works fine)
When I compile it I get an error on the "public class HelloWorld extends Applet implements MouseListener{" line, saying:
HelloWorld is not abstract and does not override abstract method mouseReleased(java.awt.event.MouseEvent) in java.awt.event.MouseListener
And I've got no idea what that means. Any help?