A simple jQuery calculator implements the continuous computing function.

Source: Internet
Author: User

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.