Langsung ke konten utama

Postingan

Menampilkan postingan dari November, 2018

Tugas 2 APSI: ERD dan DFD Sistem Ticketing Kereta Api

Tugas 2 APSI: ERD dan DFD Sistem Ticketing Kereta Api DFD Level 0 DFD Level 1 DFD Level 2 ERD

Tugas 8a PBO: ImageViewer 1.0

Class ImageViewer: 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() { int returnVal = fileChooser.showOpenDialog(frame); if(returnVal != JFileChooser.APPROVE_OPTION) { return; } File selectedFile = fileChooser.getSelectedFile(); currentImage = ImageFileManager.loadImage(selectedFile); if(currentImage == null) { // image file was not a valid image JOptionPane.show

Tugas 7 PBO: Fox & Rabbit Simulator

Class Location: public class Location { private int row; private int col; public Location(int row, int col) { this.row = row; this.col = col; } public boolean equals(Object obj) { if(obj instanceof Location) { Location other = (Location) obj; return row == other.getRow() && col == other.getCol(); } else { return false; } } public String toString() { return row + "," + col; } public int hashCode() { return (row << 16) + col; } public int getRow() { return row; } public int getCol() { return col; } } Class Field: import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Random; public class Field { private static final Random rand = Randomizer.getRandom(); priva