Design a GUI to calculate total bill amount for a shop if 1) Price per shirt is 120, price per trouser is 100 & price per cardigan is 220. 2) Discount is calculated as on the basis of payment mode :- a)credit = 0% b)cash- more than 10000 = 12% b/w 7000 & 10000 = 10% less than 7000 = 5%
Solution:- private void jCheckBox1ItemStateChanged(java.awt.event.ItemEvent evt) { // TODO add your handling code here: if(jCheckBox1.isSelected()) { jTextField1.setEditable(true); jTextField1.setText(null); jTextField2.setText(""+120); } else if(jCheckBox1.isSelected()==false) { jTextField1.setEditable(false); jTextField1.setText("0"); jTextField2.setText(""+0); } }
private void jCheckBox2ItemStateChanged(java.awt.event.ItemEvent evt) { // TODO add your handling code here: if(jCheckBox2.isSelected()) { jTextField3.setEditable(true); jTextField3.setText(null); jTextField4.setText(""+100); } else if(jCheckBox2.isSelected()==false) { jTextField3.setEditable(false); jTextField3.setText(""+0); jTextField4.setText(""+0); } }
private void jCheckBox3ItemStateChanged(java.awt.event.ItemEvent evt) { // TODO add your handling code here: if(jCheckBox3.isSelected()) { jTextField5.setEditable(true); jTextField6.setText(""+220); jTextField5.setText(null); } else if(jCheckBox3.isSelected()==false) {