/**
*Text generated by Simple GUI Extension for BlueJ
*Update by Jeff Borland
*
*
**/
import javax.swing.UIManager.LookAndFeelInfo;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import javax.swing.border.Border;
import java.awt.image.*;
import java.util.Scanner;
import javax.swing.*;
/**
*Description of project goes here
*Author
*
*
**/
public class AnnoyTheUser extends BorlandBase {
int circleX=50;
int circleY=50;
int circleSize=20;
//Constructor
public void initialize(){
setWidth(500);
setHeight(400);
setScreenLayout(null);
setBackgroundColor(new Color(0,192,192));
//adding components to contentPane panel
}
//If you would like something painted when program opens
public void paintScreen(Graphics g)
{
//Im drawing a circle with upper left corner of 50,50 and diameter of 20.
g.setColor(Color.red);
g.fillOval(circleX,circleY,circleSize,circleSize);
}
//If the mouse button is clicked, this method is called
public void mouseMoved(MouseEvent e)
{
//int x=e.getX();
//int y=e.getY();
//Graphics g = getG();
//DO YOUR DRAWING HERE
//drawScreen();
}
//If the mouse button is clicked, this method is called
public void mouseDragged(MouseEvent e)
{
//int x=e.getX();
//int y=e.getY();
//Graphics g = getG();
//DO YOUR DRAWING HERE
//drawScreen();
}
public double distanceToCenter(int centerX, int centerY, int mouseX, int mouseY)
{
int a=centerX-mouseX;
int b=centerY-mouseY;
return Math.sqrt(a*a+b*b);
}
public static void main(String[] args){
try{ BorlandBase.main((BorlandBase)(new Object() { }.getClass().getEnclosingClass().newInstance())); }
catch (Exception e){e.printStackTrace();}
}
}