SlideShare una empresa de Scribd logo
1 de 4
Npm : 201243501128
Nama : Kiuntoro
Kelas : R7H
Mata Kuliah : Komputer Grafik
Dosen : Nahot Frastian , M.Kom
Program Studi : Teknik Informatika
Universitas : Universitas Indraprasta Pgri
Program : MyLine2D
Input :
import java.awt.* ;
import java.applet.* ;
import java.awt.geom.* ;
public class myline2d extends java.applet.Applet {
public void paint ( Graphics g ) {
float dashes [] = {10.0f} ;
BasicStroke stroke1 = new BasicStroke (5.0f,1,2,1.0f,dashes,0.0f) ;
Graphics2D g2d = ( Graphics2D) g ;
setBackground ( Color.black);
g2d.setPaint ( Color.blue ) ;
g2d.setStroke(stroke1);
for ( int i = 0 ; i <= 43; i++ )
g2d.draw (new Line2D.Double (150,150,150 + ((int)
150*Math.cos(i)),150+((int)150*Math.sin(i))));
}
}
- Proses
 Meneteapkan pola garis dengan menggunakan float dashes [] = {10.0f}
 Lalu basicStroke mengggunakan variabel stroke1 dengan new BasicStroke
(5.0f,1,2,1.0f,dashes,0.0f)
 Lalu memilih objek grafik2D Yang menggunakan Variabel g2d
 Lalu menggunakan background jitam dengan setBackground(Color.black);
 Lalu mengganti warna objek menjadi biru dengan setPaint ( Color.blue);
Lalu membuat garis yang dikombinasikan dengan pola garis yang dilakukan dengan
pengulangan for ( int i = 0 ; i <= 43; i++ ) g2d.draw (new Line2D.Double (150,150,150
+ ((int) 150*Math.cos(i)),150+((int)150*Math.sin(i))));
- Output

Más contenido relacionado

La actualidad más candente (20)

Segiempat1
Segiempat1Segiempat1
Segiempat1
 
Soalno1a
Soalno1aSoalno1a
Soalno1a
 
Tugas soal no 2
Tugas soal no 2Tugas soal no 2
Tugas soal no 2
 
Soal2
Soal2Soal2
Soal2
 
Kotak3d
Kotak3dKotak3d
Kotak3d
 
Kotak3d
Kotak3dKotak3d
Kotak3d
 
Line2
Line2Line2
Line2
 
Batang
BatangBatang
Batang
 
Grafik batang
Grafik batangGrafik batang
Grafik batang
 
Myline
MylineMyline
Myline
 
Kotak3d
Kotak3dKotak3d
Kotak3d
 
Kotak3 d
Kotak3 dKotak3 d
Kotak3 d
 
Rect
RectRect
Rect
 
2011420135 pengenalan wajah
2011420135 pengenalan wajah2011420135 pengenalan wajah
2011420135 pengenalan wajah
 
Grafik batang
Grafik batangGrafik batang
Grafik batang
 
Rect
RectRect
Rect
 
Rumah
RumahRumah
Rumah
 
Segiempat
SegiempatSegiempat
Segiempat
 
Algoritma dan Pemrograman C++ (Control Structure)
Algoritma dan Pemrograman C++ (Control Structure)Algoritma dan Pemrograman C++ (Control Structure)
Algoritma dan Pemrograman C++ (Control Structure)
 
3
33
3
 

Destacado

Реклама вконтакте настройка
Реклама вконтакте настройкаРеклама вконтакте настройка
Реклама вконтакте настройкаHiconversion
 
Design e Sviluppo di una Web Application per Smart TV
Design e Sviluppo di una Web Application per Smart TVDesign e Sviluppo di una Web Application per Smart TV
Design e Sviluppo di una Web Application per Smart TVSilvio D'Orazio
 
The influence of ambient conditions on properties of MgxZn1-xO films by sputt...
The influence of ambient conditions on properties of MgxZn1-xO films by sputt...The influence of ambient conditions on properties of MgxZn1-xO films by sputt...
The influence of ambient conditions on properties of MgxZn1-xO films by sputt...M.I. Joaquin Torres Salas
 
OPS 571 Final Exam 2015 version
OPS 571 Final Exam 2015 versionOPS 571 Final Exam 2015 version
OPS 571 Final Exam 2015 versionchelseymerdita
 
Antologia y comentario de textos filosoficos. empirismo
Antologia y comentario de textos filosoficos. empirismoAntologia y comentario de textos filosoficos. empirismo
Antologia y comentario de textos filosoficos. empirismoMaximiliano Benavides Beltrán
 
La biblia por de los tales
La biblia por de los talesLa biblia por de los tales
La biblia por de los talesLuz Milagro
 
Memòria general de centre
Memòria general de centreMemòria general de centre
Memòria general de centreErnest Lluch
 
Llibres de text 16 17
Llibres de text 16 17Llibres de text 16 17
Llibres de text 16 17Ernest Lluch
 
Proposal usaha Pembesaran bibit ikan lele unggul
Proposal usaha Pembesaran bibit ikan lele unggulProposal usaha Pembesaran bibit ikan lele unggul
Proposal usaha Pembesaran bibit ikan lele unggulBung HaFied
 
Grafikbatang
GrafikbatangGrafikbatang
Grafikbatangkiuntoro
 
Vinfotech Healthcare Slidedeck
Vinfotech Healthcare Slidedeck Vinfotech Healthcare Slidedeck
Vinfotech Healthcare Slidedeck Bhavesh Rawal
 
Presentación yetsy extincion obligacion tributaria.
Presentación yetsy extincion obligacion tributaria.Presentación yetsy extincion obligacion tributaria.
Presentación yetsy extincion obligacion tributaria.yetsycardenas
 
Evolución del TPACK
Evolución del TPACKEvolución del TPACK
Evolución del TPACKravaprende
 

Destacado (20)

Peuples ignores
Peuples ignoresPeuples ignores
Peuples ignores
 
10clavesparaaprenderrainterpretar danielcassany
10clavesparaaprenderrainterpretar danielcassany10clavesparaaprenderrainterpretar danielcassany
10clavesparaaprenderrainterpretar danielcassany
 
Реклама вконтакте настройка
Реклама вконтакте настройкаРеклама вконтакте настройка
Реклама вконтакте настройка
 
No3
No3No3
No3
 
Design e Sviluppo di una Web Application per Smart TV
Design e Sviluppo di una Web Application per Smart TVDesign e Sviluppo di una Web Application per Smart TV
Design e Sviluppo di una Web Application per Smart TV
 
Video worksheet
Video worksheetVideo worksheet
Video worksheet
 
The influence of ambient conditions on properties of MgxZn1-xO films by sputt...
The influence of ambient conditions on properties of MgxZn1-xO films by sputt...The influence of ambient conditions on properties of MgxZn1-xO films by sputt...
The influence of ambient conditions on properties of MgxZn1-xO films by sputt...
 
OPS 571 Final Exam 2015 version
OPS 571 Final Exam 2015 versionOPS 571 Final Exam 2015 version
OPS 571 Final Exam 2015 version
 
Antologia y comentario de textos filosoficos. empirismo
Antologia y comentario de textos filosoficos. empirismoAntologia y comentario de textos filosoficos. empirismo
Antologia y comentario de textos filosoficos. empirismo
 
La biblia por de los tales
La biblia por de los talesLa biblia por de los tales
La biblia por de los tales
 
Memòria general de centre
Memòria general de centreMemòria general de centre
Memòria general de centre
 
DIPTIC SIMULACRE
DIPTIC SIMULACREDIPTIC SIMULACRE
DIPTIC SIMULACRE
 
Llibres de text 16 17
Llibres de text 16 17Llibres de text 16 17
Llibres de text 16 17
 
Proposal usaha Pembesaran bibit ikan lele unggul
Proposal usaha Pembesaran bibit ikan lele unggulProposal usaha Pembesaran bibit ikan lele unggul
Proposal usaha Pembesaran bibit ikan lele unggul
 
Grafikbatang
GrafikbatangGrafikbatang
Grafikbatang
 
Vinfotech Healthcare Slidedeck
Vinfotech Healthcare Slidedeck Vinfotech Healthcare Slidedeck
Vinfotech Healthcare Slidedeck
 
Presentación yetsy extincion obligacion tributaria.
Presentación yetsy extincion obligacion tributaria.Presentación yetsy extincion obligacion tributaria.
Presentación yetsy extincion obligacion tributaria.
 
Grafik
GrafikGrafik
Grafik
 
test slideshare
test slidesharetest slideshare
test slideshare
 
Evolución del TPACK
Evolución del TPACKEvolución del TPACK
Evolución del TPACK
 

Similar a Myline2d

Similar a Myline2d (14)

Soal1b
Soal1bSoal1b
Soal1b
 
Tugas soal no1 b
Tugas soal no1 bTugas soal no1 b
Tugas soal no1 b
 
Tugas no 1 b
Tugas no 1 bTugas no 1 b
Tugas no 1 b
 
Satutitikhilang
SatutitikhilangSatutitikhilang
Satutitikhilang
 
Tugas no 2
Tugas no 2Tugas no 2
Tugas no 2
 
Lampu(kreatifitas)
Lampu(kreatifitas)Lampu(kreatifitas)
Lampu(kreatifitas)
 
Drawtext
DrawtextDrawtext
Drawtext
 
Duatitik
DuatitikDuatitik
Duatitik
 
Draw text
Draw textDraw text
Draw text
 
Drawtext
DrawtextDrawtext
Drawtext
 
Drawtext
DrawtextDrawtext
Drawtext
 
Drawtext
DrawtextDrawtext
Drawtext
 
Komputer grafik 1
Komputer grafik 1Komputer grafik 1
Komputer grafik 1
 
Komputer grafik 1
Komputer grafik 1Komputer grafik 1
Komputer grafik 1
 

Más de kiuntoro

Más de kiuntoro (20)

Makalah Komgraf
Makalah KomgrafMakalah Komgraf
Makalah Komgraf
 
Presentasi makalah
Presentasi makalahPresentasi makalah
Presentasi makalah
 
Warna rgb
Warna rgbWarna rgb
Warna rgb
 
Uts
UtsUts
Uts
 
Soal1a
Soal1aSoal1a
Soal1a
 
Font1
Font1Font1
Font1
 
Font
FontFont
Font
 
Program project khusus
Program project khususProgram project khusus
Program project khusus
 
Myline3
Myline3Myline3
Myline3
 
Myline1
Myline1Myline1
Myline1
 
Kotak
KotakKotak
Kotak
 
Garis
GarisGaris
Garis
 
Drawoval
DrawovalDrawoval
Drawoval
 
Bintang2
Bintang2Bintang2
Bintang2
 
Segiempat1
Segiempat1Segiempat1
Segiempat1
 
Segiempat
SegiempatSegiempat
Segiempat
 
Polygon
PolygonPolygon
Polygon
 
Oval
OvalOval
Oval
 
Myoval2
Myoval2Myoval2
Myoval2
 
Myoval1
Myoval1Myoval1
Myoval1
 

Myline2d

  • 1. Npm : 201243501128 Nama : Kiuntoro Kelas : R7H Mata Kuliah : Komputer Grafik Dosen : Nahot Frastian , M.Kom Program Studi : Teknik Informatika Universitas : Universitas Indraprasta Pgri Program : MyLine2D Input : import java.awt.* ; import java.applet.* ; import java.awt.geom.* ; public class myline2d extends java.applet.Applet { public void paint ( Graphics g ) { float dashes [] = {10.0f} ; BasicStroke stroke1 = new BasicStroke (5.0f,1,2,1.0f,dashes,0.0f) ;
  • 2. Graphics2D g2d = ( Graphics2D) g ; setBackground ( Color.black); g2d.setPaint ( Color.blue ) ; g2d.setStroke(stroke1); for ( int i = 0 ; i <= 43; i++ ) g2d.draw (new Line2D.Double (150,150,150 + ((int) 150*Math.cos(i)),150+((int)150*Math.sin(i)))); } }
  • 3. - Proses  Meneteapkan pola garis dengan menggunakan float dashes [] = {10.0f}  Lalu basicStroke mengggunakan variabel stroke1 dengan new BasicStroke (5.0f,1,2,1.0f,dashes,0.0f)  Lalu memilih objek grafik2D Yang menggunakan Variabel g2d  Lalu menggunakan background jitam dengan setBackground(Color.black);  Lalu mengganti warna objek menjadi biru dengan setPaint ( Color.blue); Lalu membuat garis yang dikombinasikan dengan pola garis yang dilakukan dengan pengulangan for ( int i = 0 ; i <= 43; i++ ) g2d.draw (new Line2D.Double (150,150,150 + ((int) 150*Math.cos(i)),150+((int)150*Math.sin(i))));