Question: My button will not print out any statements when it is supposed to print the total amount. This is Java GUI Code: import javax.swing.*; import
My button will not print out any statements when it is supposed to print the total amount. This is Java GUI
Code:
import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;
public class CEP_P01 implements ActionListener { private int dormCost = 0; private int mealCost = 0; private int costOfTotalCharges = 0; private Object variable; private String costOfTotalChargesLabel; public CEP_P01() { JPanel dormPanel = new JPanel(); JFrame frame = new JFrame ("Dorm Calculator"); frame.setVisible(true); String[] dormNames = new String[] {"Allen Hall", "Pike Hall", "Farthing Hall", "University Suites" }; JLabel dormLabel = new JLabel("Enter dorm room hall name:"); dormLabel.getText(); dormPanel.add(dormLabel); JComboBox
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
