public void actionPerformed(ActionEvent ae) { float A=0; int a = Integer.parseInt(tf1.getText()); if(ae.getSource()==b2) { A=(((30*a*14) / 100)+(30*a)); System.out.println("Dosa"+"*"+a+" = "+(A));//Buton 1 } if(ae.getSource()==b3) { A=(((20*a*14) / 100)+(30*a)); System.out.println("Idly"+"*"+a+" = "+(A));//Button 2 } if(ae.getSource()==b4) { A=(((20*a*14) / 100)+(30*a)); System.out.println("Vada"+"*"+a+" = "+(A));//Button 3 } if(ae.getSource()==b5) { A=(((30*a*14) / 100)+(30*a)); System.out.println("Poori"+"*"+a+" = "+(A));//Button4 } //I Want to add All this Buttons Please tell me which logic to be implemented l3.setText(String.valueOf(A)); }