I'm new with java and only starting to "play" with it. I'm trying to start with graphics so I wrote this code:
import java.awt.*;
import acm.graphics.*;
import acm.program.*;
public class Gui extends GraphicsProgram
{
public void init (String[] args)
{
GRect rect = new GRect(100,100,50,50);
rect.setFilled(true);
rect.setFillColor(Color.RED);
add(rect);
GOval cir = new GOval(60,60);
cir.setFilled(true);
cir.setFillColor(Color.GREEN);
add(cir);
GLabel lab = new GLabel("hello");
add(lab);
}
}
but the applet is empty.
what can be wrong?
thx.