SlideShare a Scribd company logo
1 of 4
Npm : 201243501150
Nama : Dita Erlita Sari
Kelas : R7H
Mata Kuliah : Komputer Grafik
Dosen : Nahot Frastian , M.Kom
Program Studi : Teknik Informatika
Universitas : Universitas Indraprasta PGRI
Program Komputer Grafik :
Program Uts
Input :
import java.awt.Graphics ;
import java.awt.Color;
public class uts extends java.applet.Applet {
private static Color abu = new Color (204,204,204) ;
private static Color abu2 = new Color (153,153,153);
private static Color pink = new Color (255,51,51) ;
private static Color biru = new Color (51,51,255);
private static Color pink2 = new Color (255,0,102) ;
public void paint ( Graphics g ) {
setBackground ( Color.black ) ;
// ini buat line
g.setColor ( Color.yellow );
g.drawLine (0,180,100,0);
g.drawString ( " Line 2D " ,20,200);
g.setColor ( Color.blue );
g.fillRect ( 110,0,150,180 ) ;
g.drawString ( " fillRectangLe2D " ,110,200);
g.setColor ( Color.green );
g.drawRoundRect ( 280,0,150,180,10,10 ) ;
g.drawString ( " RoundRectangLe2D " ,280,200);
g.setColor ( Color.yellow ) ;
g.drawArc ( 450,0,150,180,70,200 ) ;
g.drawString ( "Arc2D " , 480,200 ) ;
g.setColor ( abu );
g.fillOval ( 620,0,150,180 ) ;
g.drawString ( " filledElipse2D " ,640,200);
g.setColor ( Color.blue );
g.drawRect ( 0,230,100,180 ) ;
g.drawString ( " RectangLe2D " ,10,430);
g.setColor ( Color.yellow );
g.fillRect ( 110,230,150,180 ) ;
g.drawString ( " fillRectangLe2D " ,110,430);
g.setColor ( abu2 );
g.fillArc ( 280,230,150,180,65,-285 ) ;
g.drawString ( " fillArc2D " ,300,430);
g.setColor ( pink );
g.drawArc ( 450,230,150,180,0,245 ) ;
g.drawLine ( 493,400,600,320);
g.drawString ( " Arc2D " ,480,430);
g.setColor ( biru );
g.drawOval ( 620,230,150,180 ) ;
g.setColor ( pink2 ) ;
g.fillOval ( 622,232,148,178);
g.drawString ( " filledElipse2D " ,640,430);
}
}
Output:
Proses :
 drawString : kordinat x nya : 0 dan kordinat Y nya :50 , sedangkan kata String
nya : Java Graphics Basic
 drawLine nya : kordinat x1 nya 5 , x2 nya = 150 , y1 = 100 , y2 = 250
 Lalu warna yang di gunakan adalah warna merah ( setColor )
 drawRect : kordinat x1 nya 50 , x2 nya = 150 , y1 = 100 , y2 = 250
 drawRoundRect x1 = 50 ,int y = 150 , int width = 150 , int height = 250 , int
xdiam=6 , int ydiam = 12
 drawOval : kordinat x1 nya 150 , x2 nya = 250 , y1 = 100 , y2 = 55
 drawArc x1 = 50 ,int y = 100 , int width = 150 , int height = 275 , int
statangle=95 , int arcangle = 15
Output :

More Related Content

What's hot (20)

Ques 8
Ques 8Ques 8
Ques 8
 
Ques 8
Ques 8Ques 8
Ques 8
 
Boundary Fill Algorithm in C
Boundary Fill Algorithm in CBoundary Fill Algorithm in C
Boundary Fill Algorithm in C
 
Parentesi
ParentesiParentesi
Parentesi
 
My poly
My polyMy poly
My poly
 
Ruby常用写法
Ruby常用写法Ruby常用写法
Ruby常用写法
 
Python 1 liners
Python 1 linersPython 1 liners
Python 1 liners
 
Graphics in C++
Graphics in C++Graphics in C++
Graphics in C++
 
C prpgram code of design google web page
C prpgram code of design google web pageC prpgram code of design google web page
C prpgram code of design google web page
 
Monte carlo pi
Monte carlo piMonte carlo pi
Monte carlo pi
 
Interpolation graph c++
Interpolation graph c++Interpolation graph c++
Interpolation graph c++
 
analog clock C#
analog clock C#analog clock C#
analog clock C#
 
Java session14
Java session14Java session14
Java session14
 
Nonlinear analysis of frame with hinge by hinge method in c programming
Nonlinear analysis of frame with hinge by hinge method in c programmingNonlinear analysis of frame with hinge by hinge method in c programming
Nonlinear analysis of frame with hinge by hinge method in c programming
 
OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++
 
Program of bar 3 d
Program of bar 3 dProgram of bar 3 d
Program of bar 3 d
 
Binary addition using class concept in c++
Binary addition using class concept in c++Binary addition using class concept in c++
Binary addition using class concept in c++
 
เฉลยแบบฝึกหัดบทที่ 1
เฉลยแบบฝึกหัดบทที่ 1เฉลยแบบฝึกหัดบทที่ 1
เฉลยแบบฝึกหัดบทที่ 1
 
Lista Plantão 03 - 7º ano
Lista Plantão 03 - 7º anoLista Plantão 03 - 7º ano
Lista Plantão 03 - 7º ano
 
สูตร
สูตรสูตร
สูตร
 

Similar to Program uts

Basis graphics
Basis graphicsBasis graphics
Basis graphicsfahlevizha
 
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdfbfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdfshehabhamad_90
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualUma mohan
 
Programa expresiones regulares
Programa expresiones regularesPrograma expresiones regulares
Programa expresiones regularesAnel Sosa
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignmentAbdullah Al Shiam
 
Lec 7 28_aug [compatibility mode]
Lec 7 28_aug [compatibility mode]Lec 7 28_aug [compatibility mode]
Lec 7 28_aug [compatibility mode]Palak Sanghani
 
draw a pikachu in java package arreyreview- import java-awt--- import.pdf
draw a pikachu in java package arreyreview- import java-awt--- import.pdfdraw a pikachu in java package arreyreview- import java-awt--- import.pdf
draw a pikachu in java package arreyreview- import java-awt--- import.pdfJake3sTAveryn
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2Koshy Geoji
 
Circles graphic
Circles graphicCircles graphic
Circles graphicalldesign
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)JAINAM KAPADIYA
 

Similar to Program uts (20)

Basis grafik
Basis grafikBasis grafik
Basis grafik
 
Basis graphics
Basis graphicsBasis graphics
Basis graphics
 
Warna rgb
Warna rgbWarna rgb
Warna rgb
 
Kuis 1 b
Kuis 1 bKuis 1 b
Kuis 1 b
 
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdfbfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
 
Clock For My
Clock For MyClock For My
Clock For My
 
Programa expresiones regulares
Programa expresiones regularesPrograma expresiones regulares
Programa expresiones regulares
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
Lec 7 28_aug [compatibility mode]
Lec 7 28_aug [compatibility mode]Lec 7 28_aug [compatibility mode]
Lec 7 28_aug [compatibility mode]
 
draw a pikachu in java package arreyreview- import java-awt--- import.pdf
draw a pikachu in java package arreyreview- import java-awt--- import.pdfdraw a pikachu in java package arreyreview- import java-awt--- import.pdf
draw a pikachu in java package arreyreview- import java-awt--- import.pdf
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Circles graphic
Circles graphicCircles graphic
Circles graphic
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
java graphics
java graphicsjava graphics
java graphics
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)
 
FSOFT - Test Java Exam
FSOFT - Test Java ExamFSOFT - Test Java Exam
FSOFT - Test Java Exam
 

More from ditaerlita (20)

Tugas
TugasTugas
Tugas
 
Tugas soal no1
Tugas soal no1Tugas soal no1
Tugas soal no1
 
Tugas soal no1 b
Tugas soal no1 bTugas soal no1 b
Tugas soal no1 b
 
Tugas soal no 2
Tugas soal no 2Tugas soal no 2
Tugas soal no 2
 
Segiempat1
Segiempat1Segiempat1
Segiempat1
 
Segiempat
SegiempatSegiempat
Segiempat
 
Rumah
RumahRumah
Rumah
 
Rect
RectRect
Rect
 
My ovalsetengah
My ovalsetengahMy ovalsetengah
My ovalsetengah
 
Myovalacak
MyovalacakMyovalacak
Myovalacak
 
Myoval
MyovalMyoval
Myoval
 
Myline
MylineMyline
Myline
 
Line
LineLine
Line
 
Line rect
Line rectLine rect
Line rect
 
Lamp
LampLamp
Lamp
 
Kotak3d
Kotak3dKotak3d
Kotak3d
 
Kotak warna
Kotak warnaKotak warna
Kotak warna
 
Grafik garis
Grafik garisGrafik garis
Grafik garis
 
Grafik batang
Grafik batangGrafik batang
Grafik batang
 
Duatitik
DuatitikDuatitik
Duatitik
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 

Program uts

  • 1. Npm : 201243501150 Nama : Dita Erlita Sari Kelas : R7H Mata Kuliah : Komputer Grafik Dosen : Nahot Frastian , M.Kom Program Studi : Teknik Informatika Universitas : Universitas Indraprasta PGRI Program Komputer Grafik : Program Uts Input : import java.awt.Graphics ; import java.awt.Color; public class uts extends java.applet.Applet { private static Color abu = new Color (204,204,204) ; private static Color abu2 = new Color (153,153,153); private static Color pink = new Color (255,51,51) ; private static Color biru = new Color (51,51,255); private static Color pink2 = new Color (255,0,102) ; public void paint ( Graphics g ) { setBackground ( Color.black ) ;
  • 2. // ini buat line g.setColor ( Color.yellow ); g.drawLine (0,180,100,0); g.drawString ( " Line 2D " ,20,200); g.setColor ( Color.blue ); g.fillRect ( 110,0,150,180 ) ; g.drawString ( " fillRectangLe2D " ,110,200); g.setColor ( Color.green ); g.drawRoundRect ( 280,0,150,180,10,10 ) ; g.drawString ( " RoundRectangLe2D " ,280,200); g.setColor ( Color.yellow ) ; g.drawArc ( 450,0,150,180,70,200 ) ; g.drawString ( "Arc2D " , 480,200 ) ; g.setColor ( abu ); g.fillOval ( 620,0,150,180 ) ; g.drawString ( " filledElipse2D " ,640,200); g.setColor ( Color.blue ); g.drawRect ( 0,230,100,180 ) ; g.drawString ( " RectangLe2D " ,10,430); g.setColor ( Color.yellow ); g.fillRect ( 110,230,150,180 ) ; g.drawString ( " fillRectangLe2D " ,110,430); g.setColor ( abu2 ); g.fillArc ( 280,230,150,180,65,-285 ) ; g.drawString ( " fillArc2D " ,300,430); g.setColor ( pink ); g.drawArc ( 450,230,150,180,0,245 ) ; g.drawLine ( 493,400,600,320); g.drawString ( " Arc2D " ,480,430); g.setColor ( biru ); g.drawOval ( 620,230,150,180 ) ;
  • 3. g.setColor ( pink2 ) ; g.fillOval ( 622,232,148,178); g.drawString ( " filledElipse2D " ,640,430); } } Output:
  • 4. Proses :  drawString : kordinat x nya : 0 dan kordinat Y nya :50 , sedangkan kata String nya : Java Graphics Basic  drawLine nya : kordinat x1 nya 5 , x2 nya = 150 , y1 = 100 , y2 = 250  Lalu warna yang di gunakan adalah warna merah ( setColor )  drawRect : kordinat x1 nya 50 , x2 nya = 150 , y1 = 100 , y2 = 250  drawRoundRect x1 = 50 ,int y = 150 , int width = 150 , int height = 250 , int xdiam=6 , int ydiam = 12  drawOval : kordinat x1 nya 150 , x2 nya = 250 , y1 = 100 , y2 = 55  drawArc x1 = 50 ,int y = 100 , int width = 150 , int height = 275 , int statangle=95 , int arcangle = 15 Output :