I'm having errors on lines 10 and 21 and am not sure why.....
import javax.swing.*;
import java.awt.*;
import java.awt.event. *;
public class Main extends JApplet implements MouseListener {
int x=0;int y=0;
JTextField jtf=new JTextField(" ");
public void init(){
Container c=getContentPan e();
c.setLayout(nul l);
jtf.setBounds(x ,y,jtf.getPrefe rredSizeā¦
c.setBackground (Color.RED);
c.add(jtf);
c.addMouseListe ner(this);
}
public void mouseExited(Mou seEvent me){}
public void mouseEntered(Mo useEvent me){}
public void mouseReleased(M ouseEvent me){}
public void mousePressed(Mo useEvent me){
x=me.getX();
y=me.getY();
jtf.setBounds(x ,y,jtf.getPrefe rredSize ();
repaint();
}
public void mouseClicked(Mo useEvent me){}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event. *;
public class Main extends JApplet implements MouseListener {
int x=0;int y=0;
JTextField jtf=new JTextField(" ");
public void init(){
Container c=getContentPan e();
c.setLayout(nul l);
jtf.setBounds(x ,y,jtf.getPrefe rredSizeā¦
c.setBackground (Color.RED);
c.add(jtf);
c.addMouseListe ner(this);
}
public void mouseExited(Mou seEvent me){}
public void mouseEntered(Mo useEvent me){}
public void mouseReleased(M ouseEvent me){}
public void mousePressed(Mo useEvent me){
x=me.getX();
y=me.getY();
jtf.setBounds(x ,y,jtf.getPrefe rredSize ();
repaint();
}
public void mouseClicked(Mo useEvent me){}
}
Comment