Question: USE JAVA Each student, independent of each other, should populate their interface with some hard coded data (for example, name of computer image, application name,
USE JAVA
Each student, independent of each other, should populate their interface with some hard coded data (for example, name of computer image, application name, data size, and so on).
Panel for computer images. This panel would allow the user to examine an image: list applications in that image, view additional data needs for each application , view the total data requirements . Also consider how an application may be removed .
Please I need interface design of the computer applications. You will have to make panel and a frame.
Existing Code:
Image.java
package phase4;
import java.util.ArrayList;
public class Image { private String name; // List for AppObject private ArrayList
AppObject.java
package phase4;
public class AppObject { // Data members of the App objects private String name; private int diskSize; private int coresUsed; private int ramSize; // Getters and setters /** * * @return */ public String getName() { return name; } /** * * @param name */ public void setName(String name) { this.name = name; } /** * * @return */ public int getDiskSize() { return diskSize; } /** * * @param diskSize */ public void setDiskSize(int diskSize) { this.diskSize = diskSize; } /** * * @return */ public int getCoresUsed() { return coresUsed; } /** * * @param coresUsed */ public void setCoresUsed(int coresUsed) { this.coresUsed = coresUsed; } /** * * @return */ public int getRamSize() { return ramSize; } /** * * @param ramSize */ public void setRamSize(int ramSize) { this.ramSize = ramSize; }
}
phas4.java
package phase4;
public class Main { public static void main(String[] args) { // creating the Image object Image image = new Image(); image.setName("macOs");
// creating and adding the AppObjects AppObject app0 = new AppObject(); app0.setName("Safari"); app0.setDiskSize(10); app0.setCoresUsed(20); app0.setRamSize(30); image.addApplication(app0, 0);
AppObject app1 = new AppObject(); app1.setName("Garage Band"); app1.setDiskSize(20); app1.setCoresUsed(40); app1.setRamSize(60); image.addApplication(app1, 1);
// initializing total data requirements int totalDiskSize = 0; int totalCoresUsed = 0; int totalRamSize = 0;
// listing applications in the image System.out.println("Applications in image " + image.getName() + ":"); for(int i = 0; i < image.getNumberOfApplications(); ++i) { String name = image.getApplication(i).getName(); int diskSize = image.getApplication(i).getDiskSize(); int coresUsed = image.getApplication(i).getCoresUsed(); int ramSize = image.getApplication(i).getRamSize();
// updating stats totalDiskSize += diskSize; totalCoresUsed += coresUsed; totalRamSize += ramSize;
// printing stats about each application System.out.println(" Application " + name + ":"); System.out.println(" Disk size: " + diskSize); System.out.println(" Cores used: " + coresUsed); System.out.println(" Ram size: " + ramSize); }
// printing total data requirements System.out.println(" Total data requirements:"); System.out.println(" Total disk size: " + totalDiskSize); System.out.println(" Total cores used: " + totalCoresUsed); System.out.println(" Total ram size: " + totalRamSize); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
