Calcolatrice java

Materie:Appunti
Categoria:Informatica

Voto:

1.5 (2)
Download:174
Data:26.07.2007
Numero di pagine:1
Formato di file:.txt (File di testo)
Download   Anteprima
calcolatrice-java_1.zip (Dimensione: 1.5 Kb)
trucheck.it_calcolatrice-java.txt     8.03 Kb
readme.txt     59 Bytes


Testo

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.lang.Math;

public class Calcolatrice extends JFrame {
final JTextField tf;
Double parziale;
Double risultato;
int operazione = 0;

public Calcolatrice() {

/**
* interfaccia
*/

super("Calcolatrice");
setDefaultCloseOperation(EXIT_ON_CLOSE);

tf = new JTextField("");
tf.setHorizontalAlignment(JTextField.RIGHT);
tf.setEditable(false);
tf.selectAll();

Button canc = new Button("canc");
canc.setBackground(Color.YELLOW);

Button numeri[] = {new Button("7"), new Button("8"), new Button("9"),
new Button("4"), new Button("5"), new Button("6"),
new Button("1"), new Button("2"), new Button("3"),
new Button("0"), new Button("-/+"), new Button("=")};

for (int i=0; i

Esempio



  


  1. Howdy

    I'm socehkd that I found this info so easily.