I think the problem is that you define smallclick, mediumclick and largeclick outside of the method that acctualy uses them.
Another problem is that you are using mouseExited() method and not mouseClicked()
package Random;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class MouseActions implements MouseListener {
public void mouseClicked(MouseEvent e) {
boolean smallclick=smallbox.contains(e.getX(),e.getY());
boolean mediumclick=mediumbox.contains(e.getX(),e.getY());
boolean largeclick=largebox.contains(e.getX(),e.getY());
if(smallclick && mediumclick && largeclick)
{
score=score+200;
}
else if(smallclick && mediumclick)
{
score= score + 150;
}
else if(smallclick && largeclick)
{
score= score + 125;
}
else if(mediumclick && largeclick)
{
score= score +110;
}
else if( smallclick)
{
score=score + 100;
}
else if(mediumclick)
{
score=score +75;
}
else if(largeclick)
{
score=score+50;
}
else if (!smallclick &&!mediumclick &&!largeclick)
{
score=score -1;
}
}
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
}
Also somehow you will have to define score variable and objects: smalbox, mediumbox and largebox
So you will be able to use them in this class.