How to implement GUI to my code? I know how to make the buttons and etc i just dont know how to "connect them together"
thanks
`import java.util.Scanner;
public class Pizza {
public static void main(String[] args) {
Scanner inScan = new Scanner(System.in);
int choice, choiceEnd, howMany, pizzaNumber;
double totalCost, sPizzaCost, eCheese, pep, gPeppers, mushrooms, sausage, onion;
String pizzaName, pizzaSize;
totalCost = 0;
sPizzaCost = 0;
double thin , thick;
System.out.println("Would you like to order a pizza?");
System.out.println("1. Yes");
System.out.println("2. No");
System.out.println();
choiceEnd = inScan.nextInt();
while (choiceEnd < 2)
if (choiceEnd == 1) {
System.out.println("Which pizza size do you want?");
System.out.println("1. Thin (7.99)");
System.out.println("2. Thick (9.99)");
pizzaName = "";
choice = inScan.nextInt();
if (choice == 1) {
sPizzaCost = 7.99;
pizzaNumber = 1;
pizzaName += " Thin ";
}
if (choice == 2) {
sPizzaCost = 9.99;
pizzaNumber = 1;
pizzaName += "Thick ";
}
System.out.println("Would you like Pepperoni on your pizza?");
System.out.println("1. Yes");
System.out.println("2. No");
choice = inScan.nextInt();
if (choice == 1) {
pep = 2.25;
sPizzaCost = sPizzaCost + pep;
pizzaName += "with Pepperoni ";
}
System.out
.println("Would you like Green Peppers on your pizza?");
System.out.println("1. Yes");
System.out.println("2. No");
choice = inScan.nextInt();
if (choice == 1) {
gPeppers = 2.37;
sPizzaCost = sPizzaCost + gPeppers;
pizzaName += "with Green Peppers ";
}
System.out.println("Would you like Mushrooms on your pizza?");
System.out.println("1. Yes");
System.out.println("2. No");
choice = inScan.nextInt();
if (choice == 1) {
mushrooms = 2.05;
sPizzaCost = sPizzaCost + mushrooms;
pizzaName += "with Mushrooms ";
}
System.out.println("Would you like Sausages on your pizza?");
System.out.println("1. Yes");
System.out.println("2. No");
choice = inScan.nextInt();
if (choice == 1) {
sausage = 2.75;
sPizzaCost = sPizzaCost + sausage;
pizzaName += "with Sausage ";
}
System.out.println("Would you like Onions on your pizza?");
System.out.println("1. Yes");
System.out.println("2. No");
choice = inScan.nextInt();
if (choice == 1) {
onion = 1.50;
sPizzaCost = sPizzaCost + onion;
pizzaName += "with Onions ";
}
System.out.println();
System.out.print("Pizza Order");
System.out.println("Amount Due");
}
}`