I'm having problems figuring where I need to go next in this project to create an applet from this application... any suggestions where I should start (in layman's terms)?
import javax.swing.*;
public class storageSP {
public static void main(String[] args) {
//declare variables
float res;
String kfilm;
String sfps;
float fps;
String sminutes;
String sseconds;
float minutes;
float seconds;
float minsec;
float Bit;
float Byte;
float kbyte;
float mbyte;
float gbyte;
float tbyte;
//int pbyte; if needed in the future
Object size;
float storage;
double perc50;
int ultStorage;
//#get k of film
kfilm = JOptionPane.showInputDialog("Please enter film type 1k,2k, 4k, or 8k? ");
if (kfilm.equals("1k")){
res = 1024*778;//796672
}
else if (kfilm.equals("2k")){
res = 2048*1556;//3186688
}
else if (kfilm.equals("4k")){
res = 4096*3112;//12746752
}
else if (kfilm.equals("8k")){
res = 8192*6224;//50987008
}
else {
return;
}
//get fps
sfps = JOptionPane.showInputDialog("How many frames/second? 30 (COMMON - mono), 60 (stereo), or 24 (film) ");
fps = Integer.parseInt(sfps.trim());
//How long?
sminutes = JOptionPane.showInputDialog("How many minutes? ");
sseconds = JOptionPane.showInputDialog("How many seconds? ");
minutes = Integer.parseInt(sminutes.trim());
seconds = Integer.parseInt(sseconds.trim());
if (minutes >0){
minsec = minutes*60;
minsec = minsec+seconds;
}
else {
minsec = seconds;
}
//# Measurement in Bits, Bytes...etc
Bit=res*4*fps*minsec;//resolution*4channels*fps*minutes and seconds
Byte = Bit/8;
kbyte = Byte/1024;
mbyte = kbyte/1024;
gbyte = mbyte/1024;
tbyte = gbyte/1024;
//# figure the bits, bytes, kbytes, mbytes, gbytes, tbytes, or pbytes needed
if (Bit < 1024){
size = "Bit";
storage = Bit;
}
else if (Byte < 1024){
size = "Byte";
storage = Byte;
}
else if (kbyte < 1024){
size = "kB";
storage = kbyte;
}
else if (mbyte < 1024){
size = "MB";
storage = mbyte;
}
else if (gbyte < 1024){
size = "GB";
storage = gbyte;
}
else if (tbyte < 1024){
size = "TB";
storage = tbyte;
}
else{
return;
}
perc50 = storage * .50;//50 percent of storage
ultStorage = (int) (storage+perc50);
//#need to ensure proper storage space
JOptionPane.showMessageDialog(null,"Size of project is: "+storage+" "+size+
"\nTherefore, you'll need "+ultStorage+" "+size+" of space.");
}
}