Professional Documents
Culture Documents
Java Code
Java Code
Java Code
/**
*
* @author user
*/
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import static javax.swing.JFrame.EXIT_ON_CLOSE;
public Project(){
titleL=new JLabel("Vending Mahcine");
PriceL=new JLabel("Number|Name|Price");
AskTF1=new JTextField("What is your order? ");
AskTF2=new JTextField("How much is your money? ");
Yes=new JButton("Yes");
No=new JButton("No");
SB=new ButtonHandler1();
IB=new ButtonHandler2();
Yes.addActionListener(SB);
No.addActionListener(IB);
pane.add(AskL2);
pane.add(AskTF2);
pane.add(Yes);
pane.add(No);
setVisible(true);
setTitle("VendingMAchine");
setSize(Width,Height);
setDefaultCloseOperation(EXIT_ON_CLOSE);
ITE.setAnswer(Integer.parseInt(input1));
ITE.setAnswer2(Integer.parseInt(input2));