JOptionPane

PHOTO EMBED

Sat Oct 19 2024 14:13:15 GMT+0000 (Coordinated Universal Time)

Saved by @Saging #java

package com.mycompany.presentation;

import javax.swing.JOptionPane;

public class Presentation {
    public static void main(String[] args) {
        
        //Choices
        int option = JOptionPane.showConfirmDialog(null,
                "Are you sure you want to proceed?",
                "Confirmation",
                JOptionPane.YES_NO_OPTION);
        
        if (option == JOptionPane.NO_OPTION) {
            JOptionPane.showMessageDialog(null,
                "Ok",
                "End",
                0);
            System. exit(0);
        }
        //Fill in
        String FirstName = (String)JOptionPane.showInputDialog(null,
                "What is your First Name? ",
                "Personal Information",
                3,
                null,
                null,
                "Joshua");
        //Fill in
        String MiddleName = (String)JOptionPane.showInputDialog(null,
                "What is your Middle Initial? ",
                "Personal Information",
                3,
                null,
                null,
                "M");
        //Fill in
        String LastName = (String)JOptionPane.showInputDialog(null,
                "What is your Last Name? ",
                "Personal Information",
                3,
                null,
                null,
                "Santelices");
        
        //Full Name
        String FullName = FirstName + " " + MiddleName + " " + LastName;
        
        // Option
        int Confirmname = JOptionPane.showConfirmDialog(null,
                "Is your name " + FullName + "?",
                "Personal Information",
                JOptionPane.YES_NO_OPTION);
        
        int i=-1;
        do {
            if (Confirmname == JOptionPane.YES_OPTION){
                i++;
            } else {
            //Fill in
        FirstName = (String)JOptionPane.showInputDialog(null,
                "What is your First Name? ",
                "Personal Information",
                3,
                null,
                null,
                "Joshua");
        //Fill in
        MiddleName = (String)JOptionPane.showInputDialog(null,
                "What is your Middle Initial? ",
                "Personal Information",
                3,
                null,
                null,
                "M");
        //Fill in
        LastName = (String)JOptionPane.showInputDialog(null,
                "What is your Last Name? ",
                "Personal Information",
                3,
                null,
                null,
                "Santelices");
        
        //Full Name
        FullName = FirstName + " " + MiddleName + " " + LastName;
        
        Confirmname = JOptionPane.showConfirmDialog(null,
                "Is your name " + FullName + "?",
                "Personal Information",
                JOptionPane.YES_NO_OPTION);
        
            }} while (i != 0);
                
        
        
        // Fill in
        int Age = Integer.parseInt((String)JOptionPane.showInputDialog(null,
                "How old are you?",
                "Personal Information",
                3,
                null,
                null,
                "19"));
        
        //Birthyear
        int BirthYear = 2024 - Age;
        
        String ParsedBirthYear = Integer.toString(BirthYear);
        
        // Output
        JOptionPane.showMessageDialog(null,
                "Your Birthyear is " + ParsedBirthYear,
                "Personal Information",
                0); 
        
        String Crush = (String)JOptionPane.showInputDialog(null,
                "Who is your crush?",
                "Magical Thingy",
                3,
                null,
                null,
                "Jara");
        
        i = -1;
            do {
            
                //Choices
                String [] Level = {"5","4", "Nothing"};
                String Floor = (String)JOptionPane.showInputDialog(null,
                    "What Floor?",
                    "Elevator",
                    3,
                    null,
                    Level,
                    Level[2]);
                
                if (Floor != "Nothing") {
                    i++;
                }else {
                    Floor = (String)JOptionPane.showInputDialog(null,
                    "What Floor?",
                    "Elevator",
                    3,
                    null,
                    Level,
                    Level[2]);
                }
            } while (i < 0);
               
        //Output
        JOptionPane.showMessageDialog(null,
                "Enters The elevator and presses 3",
                "Girl",
                2);
            
        //Output
        JOptionPane.showMessageDialog(null,
                "And if a double decker bus crashes into us",
                "The Smiths",
                2);
        
        //Choices
        
        JOptionPane.showMessageDialog(null,
                "I love the smiths!",
                "" + Crush,
                2);
        
        String [] Start = {"Ignore", "What?"};
        String Terms = (String)JOptionPane.showInputDialog(null,
                "",
                "" + FullName,
                3,
                null,
                Start,
                Start[1]);
        
        //And If A Double Decker Bus Kills The Both Of Us
        if (Terms == "What?"){
            //Output
            JOptionPane.showMessageDialog(null,
                "I said I love the smiths!",
                "" + Crush,
                2);
            JOptionPane.showMessageDialog(null,
                "To die by your side is such a heavenly way to die~ \n I love em",
                "" + Crush,
                2);
            
            //choices
            String [] Input = {"Penge cute pics","Stare"};
            String WhatToDo = (String)JOptionPane.showInputDialog(null,
                "What to do?",
                "" + FullName,
                2,
                null,
                Input,
                Input[1]);
            
            if (WhatToDo == "Penge cute pics") {
                    //Output
                    JOptionPane.showMessageDialog(null,
                    "Kadiri ka",
                    "End",
                    0);
                    System. exit(0); 
            }
            
            //Output
            JOptionPane.showMessageDialog(null,
                "Dings",
                "Elevator",
                2);
            JOptionPane.showMessageDialog(null,
                "Walks out",
                "" + Crush,
                2);
            
            //choices
            String [] Do = {"Kiligin","Kiligin ng sobra"};
            String Kilig = (String)JOptionPane.showInputDialog(null,
                "Ano gagawin?",
                "" + FullName,
                3,
                null,
                Do,
                Do[0]);
                if (Kilig == "Kiligin ng sobra") {
                    //output
                        JOptionPane.showMessageDialog(null,
                        "Naihi sa pantalon",
                        "End",
                        0);
                        System. exit(0);
                }
                
                //output
                JOptionPane.showMessageDialog(null,
                        "What the hell",
                        "" + FullName,
                        2);
                
                //Choices
                option = JOptionPane.showConfirmDialog(null,
                "Buy a kuromi plushie for " + Crush + "?",
                "" + FullName,
                JOptionPane.YES_NO_OPTION);
                
                if (option == JOptionPane.NO_OPTION) {
                    JOptionPane.showMessageDialog(null,
                    "Aww you missed the chance",
                    "End",
                    0);
                    System. exit(0);
                }
                
                JOptionPane.showMessageDialog(null,
                    "The plushie is worth 69.50 php",
                    "Cashier",
                    0);
                    
                //Fill in
                double Budget = Double.parseDouble((String)JOptionPane.showInputDialog(null,
                    "How much money do you have?",
                    "Wallet",
                    3,
                    null,
                    null,
                    "Your Budget"));
                //Budget
                double AfterBudget = Budget - 69.50;
                //Output
                if (AfterBudget < 0) {
                    JOptionPane.showMessageDialog(null,
                    "Your budget is not enough",
                    "Cashier",
                    0);
                    
                    JOptionPane.showMessageDialog(null,
                    "Aww you missed the chance",
                    "End",
                    0);
                    
                    System. exit(0); 
                }
                //Output
                JOptionPane.showMessageDialog(null,
                    "You now only have " + AfterBudget + " Php",
                    "Cashier",
                    0);
                
                option = JOptionPane.showConfirmDialog(null,
                "Give to " + Crush + "?",
                "" + FullName,
                JOptionPane.YES_NO_OPTION);
                
                if (option == JOptionPane.YES_OPTION) {
                    JOptionPane.showMessageDialog(null,
                    "Aww thanks but I have a Boyfriend",
                    "" + Crush,
                    0);
                    JOptionPane.showMessageDialog(null,
                    "Sad Ending",
                    "End",
                    0);
                    System. exit(0);
                    }
                JOptionPane.showMessageDialog(null,
                    "Aww you missed the chance",
                    "End",
                    0);
                    System. exit(0);
            }
        }
}
content_copyCOPY