Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Lease Applicaiton Main
- //
- // This class contains the main which initilises the user interface. The majority
- // of the work is done in the LeaseContents class.
- //
- // Author: <Tom Wyatt>
- //
- //
- //
- import javax.swing.*; // Required for GUI
- import javax.swing.JOptionPane;
- import java.util.Scanner;
- public class LeaseApp
- {
- public static void main(String []args)
- {
- System.out.println("Interdum Laptops - Lease Application\n");
- LeaseContents reviewc = new LeaseContents();
- {
- String inputEmail = JOptionPane.showInputDialog(null, "Please enter a valid email address"); // This code is for the users input email box.
- Scanner emailScanner = new Scanner(inputEmail);
- String email = emailScanner;
- }
- {
- String inputRef = JOptionPane.showInputDialog(null, "Please enter your Reference Number"); //This code is for the users
- Scanner refScanner = new Scanner(inputRef); //reference number input.
- String reference = refScanner;
- }
- {
- String [] model = {"bronze", "silver", "gold"}; // used to display the option dialog for the user to pick
- int choice = JOptionPane.showOptionDialog(null, // which type of model they would like to have.
- "Select the model you wish to have",
- "Model choice",
- JOptionPane.OK_OPTION,
- JOptionPane.QUESTION_MESSAGE,
- null,
- model,
- model[0]);
- System.out.println("You chose the model type: " + model[choice]);
- }
- {
- String [] lease = {"12", "18", "24", "36"}; // used to display the option dialog for the user to pick
- int choice = JOptionPane.showOptionDialog(null, // the amount of time they can lend the system for.
- "Select the lease period, in months, which you would like to have",
- "Lease period choice",
- JOptionPane.OK_OPTION,
- JOptionPane.QUESTION_MESSAGE,
- null,
- lease,
- lease[0]);
- System.out.println("You chose the lease period of: " + lease[choice] "months");
- }
- {
- String [] additionalOpt = {"Add RAM", "Remove RAM", "Warranty", "Mouse", "Keyboard", "Monitor", "1TB HDD", "250GB SDD", "Office Software", "Finish"};
- int choice = JOptionPane.showOptionDialog(null,
- "Select Additional Options" +inserthere+ "GB Additional RAM and" +insertheretoo+ "options selected)", // used to display the additional options dialog
- "Additional Options choice", // where users can select anything additional.
- JOptionPane.OK_OPTION,
- JOptionPane.QUESTION_MESSAGE, // it will show the number of toggled selections,
- null, // aswell as the amount of RAM (to a max of 8GB)
- additionalOpt,
- additionalOpt[0]);
- System.out.println("You chose the lease period of: " + additionalOpt[choice] "months");
- }
- }
- }
Add Comment
Please, Sign In to add comment