FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN 2

dokumen-dokumen yang mirip
FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN JAVA 2

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN 2

Grafis & Applet. Viska Mutiawani, M.Sc

Pemrograman Lanjut. Interface

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN JAVA 2

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN JAVA 2

MODUL PRAKTIKUM PEMROGRAMAN BERORIENTASI OBJEK

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN 2

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN JAVA 2

Pada praktikum ini, anda akan mengimplementasikan sebuah game sederhana, bernama Smiley Face.

PENGOLAHAN CITRA Ch.3 M E N G O L A H C I T R A M E N J A D I G R A Y S C A L E Bayu Pratama RN [ ]

Problem 1. Implementasi Interface. Diberikan definisi interface BentukDuaDimensi berikut:

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN JAVA 2

Please access above link to make online appointment/ Akses tautan di atas untuk membuat perjanjian.

Secuil Cerita tentang Facebook Hacker Cup 2012 Qualification Round [Part II]

Please access above link to make online appointment/ Akses tautan di atas untuk membuat perjanjian.

PENGOLAHAN CITRA Ch.4 M E N G O L A H C I T R A M E N J A D I N E G A T I V E Bayu Pratama RN [ ]

0.5x 0.5x. 2.5x. x =

1/5. while and do Loops The remaining types of loops are while and do. As with for loops, while and do loops Praktikum Alpro Modul 3.

Nama Soal Pembagian Ring Road Batas Waktu 1 detik Nama Berkas Ringroad[1..10].out Batas Memori 32 MB Tipe [output only] Sumber Brian Marshal

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN 2

GeoGebra untuk Pembelajaran Matematika

Pemrograman Web WEEK 03 HTML LANJUT

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN 2

Applet (1) Oleh: Kholid Fathoni

Modul Praktikum 8 Pemograman Berorientasi Objek

32-bit and 64-bit Windows: Frequently asked questions

Pemrograman Web. Object Oriented Programming in PHP 5

06/03/2018. Tidak memiliki parameter. Melakukan inisialisasi semua variabel private dengan nilai awal.

Graphics2D dan Geometry

.NET Controls. Control Creation

Data Structures. Class 5 Pointer. Copyright 2006 by The McGraw-Hill Companies, Inc. All rights reserved.

: PRAKTIKUM CSS 3 [Color dan Background] NAMA : KELAS : TANGGAL PRAKTIKUM :

TPI4202 e-tp.ub.ac.id

MODIFIKASI METODE BACKTRACKING UNTUK MEMBANTU MENCARI PENYELESAIAN PERMAINAN PEG SOLITAIRE

Dwiny Meidelfi, M.Cs

Pada module ini, Anda akan mempelajari tentang membuat applet menggunakan AWT.

Pemrograman Dasar I N T R O D U C T I O N T O J A V A

Informatics Class A UISI CALCULUS I WEEK 2 DAY 2

Pemrograman Lanjut Class, Instance Variable dan Method PTIIK

Connecting & Using the BGAN for Internet Access Menghubungkan dan Menggunakan Alat BGAN

ANALISIS CAPAIAN OPTIMASI NILAI SUKU BUNGA BANK SENTRAL INDONESIA: SUATU PENGENALAN METODE BARU DALAM MENGANALISIS 47 VARIABEL EKONOMI UNTU

Pengenalan Adobe photoshop Cs 3 untuk pengolahan/editing Image

MODUL PRAKTIKUM PEMROGRAMAN BERORIENTASI OBJEK (JAVA) PERTEMUAN 1 PENGENALAN LINGKUNGAN PEMROGRAMAN JAVA

FAKULTAS TEKNIK UNIVERSITAS NEGERI YOGYAKARTA LAB SHEET PEMROGRAMAN 2

Tutorial A Menggambar Bendera Merah Putih Pada Frame

Pemrograman Lanjut. Instance Variable Access Modifier Set dan Get Method

12/8/2012 MODUL -10. Apa itu SPSS? Apa yang bisa dilakukan SPSS? Apa kesamaan SPSS dengan Microsoft Office Excel?

STUDI PERBANDINGAN PENURUNAN KELOMPOK TIANG DITINJAU DARI FAKTOR INTERAKSI DENGAN PENDEKATAN ELASTIK TESIS

Topi Anda akan membutuhkan untuk melakukan langkah-langkah ini adalah 1. A Windows 98 CD 2. A Komputer dengan CD-ROM akses

BAB III LANDASAN TEORI. muka yang bersifat grafis Graphical User Interface (GUI). Daripada menulis

ADDING RTGS BENEFICIARY FOR CHECKER MAKER SYSTEM

Package. Learning Outcomes. Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu: Introduction. Outline Materi

Monitoring Web Server dengan AWSTATS

CSS Cascading Style Sheet

Keseimbangan Torsi Coulomb

Modul 2. [access specifier] [tipe data] [nama variabel];

2. Software yang dibutuhkan Untuk membuat sebuah program java, minimal yang dibutuhkan adalah:

SUKSES BERBISNIS DI INTERNET DALAM 29 HARI (INDONESIAN EDITION) BY SOKARTO SOKARTO

NEW PIN. 5. Masukkan PIN BNI e-secure Anda yang baru sebanyak 6 (enam) angka. Enter the 6 (six) numbers of your new BNI e-secure PIN.

KESASTRAAN MELAYU TIONGHOA DAN KEBANGSAAN INDONESIA: JILID 2 FROM KPG (KEPUSTAKAAN POPULER GRAMEDIA)

Cascading Style Sheets (CSS)

Introduksi. Team Training SMK-TI I-58

5.Buatlah subclass world, beri nama subclass word :latar.pilih jalan.png sebagai image. Compile.

Paradigma Pemrograman Berorientasi Objek

PERTEMUAN 10 PENGGUNAAN PERINTAH DASAR MENU DRAW

MS.POWERPOINTsebuah handout

Pemrograman Lanjut Class and Object PTIIK

LOMBA KOMPETENSI SISWA SEKOLAH MENENGAH KEJURUAN. TEMA, KISI-KISI DAN SOAL (Mengacu pada LKS Provinsi Jawa Barat)

TRANSPOSITION TECHNIQUE

6 KERANJANG 7 LANGKAH API (INDONESIAN EDITION) BY LIM TUNG NING

Abstrak Kata Kunci :

Modul 8: awt. Setelah mengikuti mata kuliah ini mahasiswa dapat membuat program sederhana dalam lingkungan window. Modul 8 - awt 1

JAVA BASIC PROGRAMMING Joobshet

BAB VI MEMBUAT CHART & HYPERLINK

MEMBUAT JAM ANALOG. Wiranti Sri Utami. Abstrak. Pendahuluan.

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

Pemrograman dengan Java

PERUMUSAN KRITERIA BANK 'TERPOPULER BERDASARKAN FAKTOR-FAKTOR KESADARAN MERK NASABAH TESIS MAGISTER. Oleh. Henny Herawati NIM.

Langkah-langkah untuk Mendownload Software SMART PLS 2.0 dan LISREL

Cambridge International Examinations Cambridge International General Certifi cate of Secondary Education

Turing and State Machines. Mesin Turing. Turing Machine. Turing Machines 4/14/2011 IF_UTAMA 1

Operator dan Assignment. Pertemuan 3 Pemrograman Berbasis Obyek

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

GUI, Ev e Ev n e t n Handling, Ex ception Handling in Java

4.1 WARNA Ketika objek geometri dibangun, objek tersebut dapat digambar dengan method fill(shape) atau

PROSEDUR PROGRAM. Berikut ini adalah langkah-langkah instalasi aplikasi Bee Board : Gambar A.1 Installer Bee Board

Composition dan Inheritance

SOAL EKSPLORASI. Jawab: (a) Tiga buah (4 4 1, 3 3 3, 4 3 2) Skema penilaian: Satu jawaban benar nilainya 1. Dua jawaban benar nilainya

Materi. I. Pengenalan HTML II. Basic Tag HTML III. Table IV. Image

Online Purchasing System

MODUL 9 Material Texture

Pemrograman Berbasis Objek Operator dan Assignment

I. Digitasi (Digitizing) Daftar Isi. 1) Aktifkan extension JPEG (JFIF) Image Support : FILE EXTENSIONS

6. HTML & CSS. PTI15010 Pemrograman Web. Agi Putra Kharisma, S.T., M.T. Genap 2014/2015. Desain slide ini dadaptasi dari University of San Fransisco

Relasi Negara & Agama: Redefinisi Diskursus Konstitusionalisme (Rangkaian Studi IMR)

Transkripsi:

No. LST/EKA/PTI208/02 Revisi : 02 Maret 2010 Hal 1 dari 5 A. Kompetensi Setelah mengikuti mata kuliah ini, mahasiswa diharapkan memiliki kemampuan membuat applet dan grafik. B. Dasar Teori Java applets The applet is responsible for the graphical components and user interaction in a rectangular section of the Web browser's screen. An applet object has many instance variables and methods. Most of these are defined in the JApplet class. To access these definitions, your program should import javax.applet.japplet and java.awt.*. Extending the JApplet class. import javax.swing.japplet; import java.awt.*; public class Hello extends JApplet.. The setbackground() method Use the following method of the Graphics object to change the pen color: setcolor( Color.something ) For example, if gr is a reference to the Graphics object, then this changes the pen color to blue: gr.setcolor( Color.blue ); Several million colors are possible, but for now, use the pre-defined colors: Color.red Color.orange Color.yellow Color.green Color.blue Color.magenta Color.white Color.black Color.gray Color.darkGray Color.lightGray Color.pink Color.cyan The paint() method. The class JApplet has a paint() method, but that method does little. The Web browser calls the paint() method when it needs to "paint" the section of the monitor screen devoted to an applet. Each applet that you write has its own paint() method. public void paint ( Graphics gr ) {. }

No. LST/EKA/PTI208/02 Revisi : 02 Maret 2010 Hal 2 dari 5 The Graphics class. Methods of the Graphics class: o drawstring(string str, int x, int y) Ø str : a String to place into the drawing area Ø x : horizontal distance in pixels from the left edge Ø y : vertical distance in pixels from the top edge The x and y parameters tell where to place the string within the applet's area. This is like graph paper, except the (0,0) location is the upper left corner (of the applet's drawing area, not of the full screen). Increasing y values move down the area. The location (x, y) is where to place the lower left part of the first character of the string. o drawoval(int X, int Y, int width, int height) This draws a circle or an oval that fits within the rectangle specified by the X, Y, width and height arguments. The oval is drawn inside a rectangle whose upper left hand corner is at (X, Y), and whose width and height are as specified. The measurements are in terms of pixels. The (X, Y) position is relative to the upper left hand corner of the applet's drawing area. It gives the location of the upper left corner of a rectangle. The width and height arguments give the horizontal and vertical size of the rectangle. The drawoval() method draws the oval that fits inside the rectangle. (It does not actually draw the rectangle.) You do not give the method the center and radius of the circle you want.

No. LST/EKA/PTI208/02 Revisi : 02 Maret 2010 Hal 3 dari 5 o drawline(int x1, int y1, int x2, int y2)) This draws a line from (x1, y1) to (x2, y2) in the drawing area using the current pen color. As usual, the point (0,0) is the upper left corner of the drawing area. It doesn't matter in which direction you draw the line. The end and the start of the line could be reversed. o drawrect(int x, int y, int width, int height) It draws the outline of a rectangle using the current pen color. The left and right edges of the rectangle are at x and x + width respectively. The top and bottom edges of the rectangle are at y and y + height respectively. This method is also used to draw a square. This applet draws a rectangle around the entire drawing area, then puts another rectangle in the center. Running an JApplet An applet does not have a main() method and so cannot be started as an application. For the applet to do anything, some other application must be running and call the applet's methods. A Web browser can do this. A Web page is a text file that a Web browser can display. The browser follows instructions that are part of the text to nicely format the page. Here is a tiny Web page that asks for the applet Hello: <html> <body> <applet code="hello.class" width="300" height="150"> </applet> </body> </html> This tells the browser to run the applet Hello.class, and to use a 300 pixels wide and 150 high drawing area. Quote marks are required around all the values, including the numbers, but usually web browsers will work if you forget them. You can create this Web page by typing the above characters into a text editor (or copy and paste them). Then save the file as Hello.html in the same directory that has Hello.class. C. Alat/ Bahan 1. Lab. Sheet Pemrograman Java 2 2. PC / Laptop with OS installed

3. JDK 1.5 or latest 4. J-Creator or text editor FAKULTAS TEKNIK No. LST/EKA/PTI208/02 Revisi : 02 Maret 2010 Hal 4 dari 5 D. Langkah Kerja 1. Baca dan pahami dasar teori di atas. 2. Lakukan kompilasi dan eksekusi terhadap contoh-contoh source code atau program yang ada di dasar teori dan LAMPIRAN. 3. Kerjakan tugas individu di bawah. E. Tugas Individu Buatlah sebuah applet yang menampilkan: Ø 4 buah garis berbeda warna (merah, hijau, orange dan magenta). Ketebalan garis adalah 2x tebal garis pada umumnya. Ø 50 buah lingkaran berwarna biru dengan kriteria: ü Diameter semua lingkaran adalah sama ü Sumbu X memiliki selisih 3 pixel dari Sumbu X sebelumnya. ü Sumbu Y memiliki selisih 2 pixel dari Sumbu Y sebelumnya. Ø Tambahkan Nama dan NIM anda masing-masing Hasil susunan berbentuk seperti gambar di bawah ini (boleh menggunakan looping).

No. LST/EKA/PTI208/02 Revisi : 02 Maret 2010 Hal 5 dari 5 F. Lampiran CH 36, 37, dan 38 (Introduction to Computer Science using Java, Java 5.0 version, January 2006, Bradley Kjell, Central Connecticut State University http://chortle.ccsu.edu/cs151/cs151java.html) Java How to Program, Sixth Edition, H. M. Deitel - Deitel & Associates, Inc., P. J. Deitel - Deitel & Associates, Inc