Skip to content

Instantly share code, notes, and snippets.

@yuristianto
Created January 6, 2019 14:25
Show Gist options
  • Save yuristianto/b2b62da1cf1618e2f676e9cfcec67617 to your computer and use it in GitHub Desktop.
Save yuristianto/b2b62da1cf1618e2f676e9cfcec67617 to your computer and use it in GitHub Desktop.
import java.applet.Applet;
import java.awt.*;
public class GraphicsDemo extends Applet{
public void paint(Graphics g){
g.setColor(Color.red);
g.drawString("Welcome",50, 50);
g.drawLine(20,30,20,300);
g.drawRect(70,100,30,30);
g.fillRect(170,100,30,30);
g.drawOval(70,200,30,30);
g.setColor(Color.pink);
g.fillOval(170,200,30,30);
g.drawArc(90,150,30,30,30,270);
g.fillArc(270,150,30,30,0,180);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment