The question is poorly worded, but I'll try to explain. I've created a vending machine where a window pops up and asks user to enter money. They then move to the main machine window and it displays the number they entered as the amount of money they have. I have a button, 'Add Money' that is supposed to add money to that current amount, but i'm not sure how to do that.
For example, a user enters that they have 2 dollars, then hits the enter key which takes them to the main machine interface that states they have 2 dollars.. The user hits the 'add money' button and types 3, denoting that they have 3 more dollars. That should mean they have 5 dollars, and will be denoted on the main interface that they have 5 dollars.
Code for the money input...
public void actionPerformed(ActionEvent arg0) {
double moneyInput;
String text = mInput.getText();
moneyInput = Double.parseDouble (text);
VendingMachineInterface frame;
try {
frame = new VendingMachineInterface(vendingMachineName, moneyInput);
frame.setVisible(true);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}