You can also download text file of this code here: MenuOrder.txt
Java Code:
private void btn1ActionPerformed(java.awt.event.ActionEvent evt) {
int Total = 0;
if (lt1.isSelectedIndex(0)==true)
{
Total = Total+150;
JOptionPane.showMessageDialog(this,"Bhel Puri Ordered Rs. 150");
}
if (lt1.isSelectedIndex(1)==true)
{
Total = Total+300;
JOptionPane.showMessageDialog(this,"Pasta Ordered Rs. 300");
}
if (lt1.isSelectedIndex(2)==true)
{
Total = Total+200;
JOptionPane.showMessageDialog(this,"Pizza Ordered Rs. 200");
}
if (lt1.isSelectedIndex(3)==true)
{
Total = Total+180;
JOptionPane.showMessageDialog(this,"Burger Ordered Rs. 180");
}
if (lt1.isSelectedIndex(4)==true)
{
Total = Total+220;
JOptionPane.showMessageDialog(this,"Pav Bhaji Ordered Rs. 220");
}
if (lt1.isSelectedIndex(5)==true)
{
Total = Total+260;
JOptionPane.showMessageDialog(this,"Chole Kulche Ordered Rs. 260");
}
if (lt1.isSelectedIndex(6)==true)
{
Total = Total+260;
JOptionPane.showMessageDialog(this,"Chowmein Ordered Rs. 260");
}
txt1.setText(Integer.toString(Total));
}
[Find More Java Codes at www.sumikuma.tk]
Comments
Post a Comment