Академический Документы
Профессиональный Документы
Культура Документы
*;
import java.awt.*;
import java.awt.event.*;
import java.text.*;
public class CalculatorApplication extends JFrame implements ActionListener {
JTextField resultField;
double operandOne;
double operandTwo;
int operator;
JButton addButton;
JButton subtractButton;
JButton multiplyButton;
JButton divideButton;
JButton percentileButton;
JButton equalsButton;
JButton dotButton;
JButton cancelButton;
JButton onebyButton;
JButton backButton;
JButton one1;
JButton two2;
JButton three3;
JButton four4;
JButton five5;
JButton six6;
JButton seven7;
JButton eight8;
JButton nine9;
JButton zero0;
Object source;
public static void main(String[] args) {
CalculatorApplication app = new CalculatorApplication();
app.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});
app.setSize(280, 240);
app.setVisible(true);
}
public CalculatorApplication() {
super();
JPanel operandPanel;
JPanel buttonPanel1;
JPanel buttonPanel2;
JPanel buttonPanel3;
JPanel buttonPanel4;
Container cp;
cp = getContentPane();
cp.setLayout(new GridLayout(5, 1));