How to solve the error in porting some Processing Codes to Java Eclipse?
in
Android Processing
•
1 year ago
I was trying to create an Android Application in Java Eclipse with the use of the Processing in Android
but when I was about to compile it, I got this error message "
The type java.awt.event.MouseListener cannot be resolved. It is indirectly referenced from required .class files". Here is my code:
//On this statement is where I got the errors, the MainActivity and the PApplet is in red underline w/c means it's an error//
public class MainActivity extends PApplet {
public static void main(String args[])
{
PApplet.main(new String[] { "--present", "com.RDP.MainActivity" });
}
Vector path = new Vector();
public void setup(){
size(550,550, P3D);
smooth();
}
public void draw(){
background(255);
LineSimplifier1 pt;
noFill();
strokeWeight(1);
beginShape();
for (int i=0; i < path.size(); i++)
{
pt = (LineSimplifier1)path.elementAt(i);vertex(pt.x,pt.y);
}
endShape();
strokeWeight(5);
beginShape(POINTS);
for (int i=0; i < path.size(); i++)
{
pt = (LineSimplifier1)path.elementAt(i);vertex(pt.x,pt.y);
}
endShape();
}
public void mousePressed(){
path = new Vector();
}
public void mouseDragged(){
path.add(new LineSimplifier1(mouseX, mouseY));
}
public void mousePressed1(){
if (path.size() > 1)
{
LineSimplifier1 [] tmp = new LineSimplifier1[path.size()-1];
for (int i =0; i < path.size()-1; i++)
{
tmp[i] = (LineSimplifier1)path.elementAt(i+1);
}
path = new Vector();
path.addAll(Arrays.asList(AndroidRDPActivity.simplifyLine2D(5,tmp)));
}
}
}
1