Wulan Putri - Komputer Grafik

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

TUGAS

KOMPUTER GRAFIK 1

NAMA : Wulan Putri P


NIM : 181011401657
Kelas : 06TPLP016

TEKNIK INFORMATIKA
FAKULTAS TEKNIK
UNIVERSITAS PAMULANG
Jl. SuryaKencana No. 1 PamulangTelp (021)7412566, Fax.
(021)7412566Tangerang Selatan-Banten
TUGAS Kerangka Dasar Program -1 dan -2 Modul Pertemuan 4.

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package geometri;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
/**
*
* @author Wulan
*/
public class ContohGeometri extends JPanel
{
public ContohGeometri(){
this.setPreferredSize(new Dimension(400, 300));
this.setBackground (Color.WHITE);
}
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 =(Graphics2D)g;
}
}
Syntax
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package geometri;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;

/**
*
* @author Wulan
*/
public class Main extends JPanel
{
public static void main(String args[]){
JFrame frame = new JFrame("WULAN PUTRI,181011401657");
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e) {System.exit(0);}
});
ContohGeometri canvas= new ContohGeometri();
frame.getContentPane().add(canvas);

frame.pack();
frame.setVisible(true);
}
}
OUTPUT

You might also like