Help with IF Statements and GUI
I am having some trouble with making a GUI and IF statements.
I need to be able to enter a number of votes for 3 particular "Art Piece's" and hit a calculate button and have the program put a checkmark next to the winner. Once the user presses the "calculate" button, the program will update the window to indicate which piece received the most votes. Ex) "piece 2 is the winner, or if there is a tie: "it is a tie between pieces 1, 2, 3".
I have some starting code here but I am unsure of how to do if statements very well. If anyine can give me some direction I would really appreciate it.
public class ArtPrize
public static void main (String args)
private JLabel inputLabel, inputLabel2, inputLabel3, resultLabel;
private JTextField ArtPrize;
inputLabel = new JLabel ("Enter the number of votes for piece 1:");
inputLabel2 = new JLabel ("Enter the number of votes for piece 2:");
inputLabel3 = new JLabel ("Enter the number of votes for piece 3:");
resultLabel = new JLabel ("-----");
ArtPrize = new JTextField (5);
ArtPrize.addActionListener (new TempListener());
setPreferredSize (new Dimension(300, 200));
private class ArtListener implements ActionListener
public void actionPerformed (ActionEvent event)
JFrame frame = new JFrame ("Art Prize");
ArtPrizePanel = new ArtPrizePanel();