I can't for the life of me figure out how to use variables in another class. I'm getting input from the user in one class and need to put it into another class. My code is below:

Code:

import javax.swing.JOptionPane;
public class CustomerOrder {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "Welcome to Pizza Palace!", "Pizza Palace", JOptionPane.INFORMATION_MESSAGE);//welcome dialog
String cheese;
String pep;
String veg;
String drink;
String order;
int numCheese;//number of cheese pizzas ordered
int numPep;//number of pepperoni pizzas ordered
int numVeg;//number of veggie pizzas ordered
int numDrink;//number of drinks ordered
int orderMore;//asks the user if they want to order more
do {//start of do loop
//brings up order dialog
Object[] possibilities = {cheese = "Cheese Pizza: $12.99", pep = "Pepperoni Pizza: $13.99", veg = "Veggie Pizza: $13.49",
drink = "Drink: $0.99"};//all the possibilities
order = (String)JOptionPane.showInputDialog(null, "What would you like to order today?","Pizza Palace",
JOptionPane.PLAIN_MESSAGE,null, possibilities,cheese);
//if the user orders cheese then we ask them how many
if(order == cheese)
{//start if
numCheese = Integer.parseInt(JOptionPane.showInputDialog("How many cheese pizzas would you like?", "0"));
}//end if
//if the user orders pepperoni then we ask them how many
if(order == pep)
{//start if
numPep = Integer.parseInt(JOptionPane.showInputDialog("How many pepporoni pizzas would you like?", "0"));
}//end if
//if the user orders veggie then we ask them how many
if(order == veg)
{//start if
numVeg = Integer.parseInt(JOptionPane.showInputDialog("How many veggie pizzas would you like?", "0"));
}//end if
//if the user orders a drink then we ask them how many
if(order == drink)
{//start if
numDrink = Integer.parseInt(JOptionPane.showInputDialog("How many drinks would you like?", "0"));
}//end if
//asks if the user wants to order more, if so, it repeats
orderMore = JOptionPane.showConfirmDialog
(null, "Would you like to order more?" , "Pizza Palace",JOptionPane.YES_NO_OPTION);
}//end do loop
//while loop, repeats do loop until the user clicks no
while(orderMore != JOptionPane.NO_OPTION);
//end while loop
ProductItem calculateorder = new ProductItem();
calculateorder.order();
}
}
class ProductItem
{
double cheesePrice = 12.99; //constant cheese pizza price
double pepperoniPrice = 13.99; //constant pepperoni pizza price
double veggiePrice = 13.49; //constant veggie pizza price
double drinkPrice = 0.99; //constant drink price
double taxRate = 0.055; //constant tax rate
double subtotal;
double tax;
double total;
public void order()
{
if(numCheese <=2 & numPep==0 & numVeg==0)
{
subtotal = (numCheese * cheesePrice) + (numDrink * drinkPrice);
tax = (subtotal * taxRate);
total = subtotal + tax;
JOptionPane.showMessageDialog(null, "Your total (without the discount) is: $" + Math.rint(total*100)/100,
"Pizza Cost",
JOptionPane.INFORMATION_MESSAGE);
}
}
}

I can't figure out how to get numCheese, numPep, numVeg, and numDrink to be recognized. I'm sure there's a pretty simple way to do this, any help would be appreciated. Just trying to learn

Thanks!