A simple jQuery calculator implements the continuous computing function.
A simple jQuery Calculator only implements a continuous computing Function
<! DOCTYPE html>
Use C to implement a simple calculator, which is highly efficient.
There is a calculator with different requirements !!
It takes too much time to declare it. I didn't write it. Let's take a look at the effect !!
There are too many texts. I can only send attachments. Sorry, I took 2 RMB !!
Java implements a simple calculator interface, coupled with appropriate event processing, to complete the computation
Import java. awt. Button;
Import java. awt. GridLayout;
Import java. awt. Panel;
Import java. awt. TextField;
Import java. awt. event. ActionEvent;
Import java. awt. event. ActionListener;
Import javax. swing. JFrame;
Import javax. swing. JLabel;
Public class Calculator extends JFrame implements ActionListener {
Private static final long serialVersionUID = 1L;
// Public static final int EXIT_ON_CLOSE = 3;
Private Button plus = new Button ("+"); // Operator
Private Button minus = new Button ("-");
Private Button multip = new Button ("*");
Private Button divise = new Button ("/");
Private Panel pan = new Panel ();
Private JLabel opl1 = new JLabel ("operand 1 ");
Private JLabel opl2 = new JLabel ("operand 2 ");
Private JLabel resl = new JLabel ("Result :");
Private TextField op1 = new TextField (10 );
Private TextField op2 = new TextField (10 );
Private TextField result = new TextField (10 );
Public Calculator ()
{
Super ("Calculator ");
Initialize ();
}
Public void initialize ()
{
This. setLayout (null );
This. setSize (360,300 );
This. setResizable (false );
This. add (pan );
Pan. setBounds (10, 10, 330,250 );
Pan. setLayout (new GridLayout (5, 1 ));
Pan. add (opl1 );
// Opl1.setBounds (10, 10, 100, 40 );
Pan. add (op1 );
// Op1.setBounds (, 10 );
Pan. add (opl2 );
// Opl2.setBounds );
Pan. add (op2 );
// Op2.setBounds (21,110,100, 40 );
Pan. add (resl );
// R... the remaining full text>