cannot find symbol constructor
i have been trying to debug this code... But i m not able to.. Hope u guys can help me.. Thanks a milllion!!!
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.*;
import javax.swing.event.*;
publicclass TryOutextends JFrame
{
Ellipse2D.Double scope;
BufferedImage image;
Dimension targetSize;
double scale;
private ImagePanel bg;
publicstaticvoid main(String[] args)
{
TryOut f =new TryOut();
f.setVisible(true);
f.setSize(850,256);
f.setDefaultCloseOperation(EXIT_ON_CLOSE);
final ScopeTest test =new ScopeTest();
}
public TryOut()
{
setSize(850,256);
setLocation(100,480);
setTitle("Tryout");
scope =new Ellipse2D.Double(0, 0, 150, 150);
targetSize =new Dimension();
ScopeController control =new ScopeController();
addMouseListener(control);
addMouseMotionListener(control);
bg=new ImagePanel();
bg.showImage(createImage("3111"));
bg.setPreferredSize(new Dimension(850,256));
getContentPane().add(bg);
}
publicclass ScopeControllerextends MouseInputAdapter
{
ScopeTest test;
Point offset;
boolean dragging;
public ScopeController(ScopeTest st)
{
test = st;
offset =new Point();
dragging =false;
}
publicvoid mousePressed(MouseEvent e)
{
Point p = e.getPoint();
if(test.scope.contains(p))
{
offset.x = (int)(p.x - test.scope.x);
offset.y = (int)(p.y - test.scope.y);
dragging =true;
}
}
publicvoid mouseReleased(MouseEvent e)
{
dragging =false;
}
publicvoid mouseDragged(MouseEvent e)
{
if(dragging)
{
int x = e.getX() - offset.x;
int y = e.getY() - offset.y;
test.setScope(x, y);
}
}
}
public Image createImage(String filename)
{
ImageIcon imageIcon=new ImageIcon ("images/"+filename+".PNG");
return imageIcon.getImage();
}
publicclass ImagePanelextends JPanel
{
private Image image=null;
publicvoid showImage(Image image)
{
this.image=image;
repaint();
}
publicvoid paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawImage(image,0,0,850,256,this);
}
}
}
=======================================================
The error shown is....
C:\Documents and Settings\user.TEMASEK-P1OHXPC\My Documents\Tanks\TryOut.java:36: cannot find symbol
symbol : constructor ScopeController()
location: class TryOut.ScopeController
ScopeController control = new ScopeController();
^
1 error
Process completed.

