java gui calculator - 40829

Solution Posted by
Solution Detail
Price: $10.00
  • From: ,
  • Posted on: Tue 14 Jan, 2014
  • Request id: # 40822
  • Purchased: 0 time(s)
  • Average Rating: No rating
Request Description
Solution Description

package calc; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextField; /** * * @author Ben */ public class GUI extends JFrame { int response, count=0; double num1, num2, num3, num5, num6, num7, num8, total=0; String operation, answer, num, testnum; private JButton one, two, three, four, five, six, seven, eight, nine, zero, multiply, divide, subtract, add, equals, clear; private JTextField display, fakedisplay; public GUI(){ super("Calculator"); setLayout (new FlowLayout()); fakedisplay = new JTextField(10); display = new JTextField(10); display.setEditable(false); add(display); one = new JButton("1"); add(one); two = new JButton("2"); add(two); three = new JButton("3"); add(three); four = new JButton("4"); add(four); five = new JButton("5"); add(five); six = new JButton("6"); add(six); seven = new JButton("7"); add(seven); eight = new JButton("8"); add(eight); nine = new JButton("9"); add(nine); zero = new