i resolved the problem with actionlistener and item listener. I got the total to display and i played around however my toppings arent working. the sizes are working in the code but the toppings are...
Type: Posts; User: remedys
i resolved the problem with actionlistener and item listener. I got the total to display and i played around however my toppings arent working. the sizes are working in the code but the toppings are...
I tried making a button using ActionListener, however I cant use an actionlistener with a itemlistener. Is there a reason for that ,and how would i go about making a button to calculate total.
So, I thought it would calculate as you pick your selections... However, will i have to make a button that once clicked will display the total of the users selection?
With the itemlistener, I believe I put if the size is selected in the Jcheckbox the size (small,medium,large,xlarge) is given a value in the if statements.
the double toppings is given a value of...
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class JPizza extends JFrame implements ItemListener
{
private int pizza = 0;
FlowLayout flow = new FlowLayout(); ...