Langsung ke konten utama

Postingan

Menampilkan postingan dari November, 2018

Image Viewer

Dalam program ini terdapat 4 Class, yaitu: 1. ImageViewer 2. ImagePanel 3. OFImage 4. Image File Manager Berikut adalah tampilan hubungan tiap class di BlueJ. Berikut adalah source code tiap classnya. 1. ImageViewer /** * Write a description of class ImageViewer here. * * @author (your name) * @version (a version number or a date) */ import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.swing.*; import java.io.File; public class ImageViewer { private static final String VERSION = "Version 1.0"; private static JFileChooser fileChooser = new JFileChooser (System.getProperty("user.dir")); private JFrame frame; private ImagePanel imagePanel; private JLabel filenameLabel; private JLabel statusLabel; private OFImage currentImage; public ImageViewer() { currentImage = null; makeFrame(); } private void openFile()

Foxes and Rabbit

Dalam program ini terdapat 9 Class, yaitu: 1. Simulator 2. Field 3. Randomizer 4. SimulatorView 5. Counter 6. FieldStats 7. Location 8. Rabbit 9. Fox Berikut adalah tampilan hubungan tiap class di BlueJ. Berikut adalah source code tiap classnya. 1. Simulator import java.util.Random; import java.util.List; import java.util.ArrayList; import java.util.Iterator; import java.awt.Color; /** * A simple predator-prey simulator, based on a rectangular field * containing rabbits and foxes. * * @author David J. Barnes and Michael Kolling * @version 2008.03.30 */ public class Simulator { // Constants representing configuration information for the simulation. // The default width for the grid. private static final int DEFAULT_WIDTH = 50; // The default depth of the grid. private static final int DEFAULT_DEPTH = 50; // The probability that a fox will be created in an

Tugas Integra PBO-B

Pada kesempatan kali ini saya akan mencoba membuat sistem integra. Disini saya nantinya akan membuat 8 class dengan menggunakan metode inheritance. Berikut adalah penggambaran classnya dengan menggunakan Blue J. Berikut adalah source code tiap classnya. Database /** * Write a description of class Database here. * * @author (your name) * @version (a version number or a date) */ import java.util.ArrayList; public class Database { private ArrayList<ID>id; public Database() { id=new ArrayList<ID>(); } public void addID(ID theID) { id.add(theID); } public void list() { for (ID id:id){ id.print(); System.out.println(); } } } ID /** * Write a description of class ID here. * * @author (your name) * @version (a version number or a date) */ public class ID { public String status; public String kode; p