StdDraw Cannot be Resolved??
I found some code online to draw a pink heart.. sort of a valentine's day heart.. I would like to add to it and customize it some... But I can't get it to work as-is.. I get a compile error that "StdDraw Cannot be resolved" ... Here is the code.. Thanks for any input!!
Code :
import java.awt.color.*;
import java.awt.Graphics;
import javax.swing.JPanel;
public class Heart {
public static void main(String[] args) {
StdDraw.setXscale(-1.5, +1.5);
StdDraw.setYscale(-1.5, +1.5);
StdDraw.setPenColor(StdDraw.PINK);
// draw diamond
double[] xs = { -1, 0, 1, 0 };
double[] ys = { 0, -1, 0, 1 };
StdDraw.filledPolygon(xs, ys);
// circles
StdDraw.filledCircle(+0.5, 0.5, 1 / Math.sqrt(2));
StdDraw.filledCircle(-0.5, 0.5, 1 / Math.sqrt(2));
}
}
Re: StdDraw Cannot be Resolved??
Hi there!
I'm pretty sure that the class StdDraw is not in the default java source. You will need to use this code to get it to work StdDraw.java
Re: StdDraw Cannot be Resolved??
Quote:
Originally Posted by
er1111
Hi there!
I'm pretty sure that the class StdDraw is not in the default java source. You will need to use this code to get it to work
StdDraw.java
Holy crow!! Is there an easier way to do this ? I'm just trying to draw a heart... lol... can this be similar to drawing a smiley face? I can do that!! 8-}