UTS GRAFIKA
package javaapplication10;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class JavaApplication10 extends JPanel {
public void
paint(Graphics g) {
int[] xs = {50,
75, 125, 125, 125, 75, 50, 50, 50, 80, 50};
int[] ys = {100,
100, 100, 100, 150, 150, 150, 100, 100, 125,150};
g.drawPolyline(xs, ys, 11);
}
public static void
main(String[] args) {
JFrame frame = new
JFrame();
frame.getContentPane().add(new
JavaApplication10());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200,250);
frame.setVisible(true);
}
}
HASIL :