Codigo Calculadora Cientifica

Páginas: 11 (2737 palabras) Publicado: 20 de abril de 2011
/*
* Botones.java
*
* Created on 1 de noviembre de 2006, 20:53
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
/**
*
* @author prueba
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.math.*;
public class Botones extends java.applet.Applet {
char signo, sgnmenos='-';
String numero="";
intnum7=7, num8=8, num9=9, num6=6, num5=5, num4=4, num3=3, num2=2, num1=1, num0=0,cont=0;
double x,y,numpi=Math.PI, nume=Math.E;
String var7,var8,var9,var6,var5,var4,var3,var2,var1,var0,varpunto;
Label etiq1, etiq2;
Button boton1, boton2, boton3, boton4, boton5, boton6, boton7, boton8, boton9, boton0;
Button decimal, igual, suma, resta, mult, div;
Button loga, raiz, seno, coseno, tangente, pi,potencia,potencia2,potencia3,factorial,ln,ex,e;
Button senh, cosh, tanh, botonC,btnsigno;
Button porciento;
TextField cuadro, color1, color2, color3;
double resp,rad;
Image img;
Button amarillo, azul, rojo, verde, gris, naranja, blanco, personalizado, aplicar, cerrar;
Label fondo;
int r,g,b;
String red,green,blue;
Label colorR, colorG, colorB;
public void init() {
initcomponents();
}void initcomponents() {
colorR=new Label("Rojo");
colorR.setBackground(Color.BLACK);
colorR.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
colorR.setForeground(Color.red);
colorR.setAlignment(1);
colorR.setVisible(false);
setLayout(null);
add(colorR);
colorR.setBounds(5,350,60,25);
colorG=new Label("Verde");
colorG.setBackground(Color.BLACK);
colorG.setFont(new Font("Comic SansMS", Font.BOLD, 14));
colorG.setForeground(Color.green);
colorG.setAlignment(1);
colorG.setVisible(false);
setLayout(null);
add(colorG);
colorG.setBounds(80,350,60,25);
colorB=new Label("Azul");
colorB.setBackground(Color.BLACK);
colorB.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
colorB.setForeground(Color.blue);
colorB.setAlignment(1);
colorB.setVisible(false);
setLayout(null);add(colorB);
colorB.setBounds(155,350,60,25);
etiq2=new Label("Colores Calculadora");
etiq2.setBackground(Color.BLACK);
etiq2.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
etiq2.setForeground(Color.green);
setLayout(null);
add(etiq2);
etiq2.setBounds(5,5,150,30);
amarillo=new Button("Amarillo");
amarillo.setBackground(Color.yellow);
amarillo.setForeground(Color.black);amarillo.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
setLayout(null);
add(amarillo);
amarillo.setBounds(5,40,100,30);
amarillo.addMouseListener(new MouseAdapter(){
public void mouseClicked (MouseEvent evt) {
amarilloMouseClicked(evt);
}
});
azul=new Button("Azul");
azul.setBackground(Color.blue);
azul.setForeground(Color.black);
azul.setFont(new Font("Comic Sans MS", Font.BOLD, 14));setLayout(null);
add(azul);
azul.setBounds(5,75,100,30);
azul.addMouseListener(new MouseAdapter(){
public void mouseClicked (MouseEvent evt) {
azulMouseClicked(evt);
}
});
rojo=new Button("Rojo");
rojo.setBackground(Color.red);
rojo.setForeground(Color.black);
rojo.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
setLayout(null);
add(rojo);
rojo.setBounds(5,110,100,30);rojo.addMouseListener(new MouseAdapter(){
public void mouseClicked (MouseEvent evt) {
rojoMouseClicked(evt);
}
});
gris=new Button("Gris");
gris.setBackground(Color.gray);
gris.setForeground(Color.black);
gris.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
setLayout(null);
add(gris);
gris.setBounds(5,145,100,30);
gris.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent evt) {
grisMouseClicked(evt);
}
});
verde=new Button("Verde");
verde.setBackground(Color.green);
verde.setForeground(Color.black);
verde.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
setLayout(null);
add(verde);
verde.setBounds(5,180,100,30);
verde.addMouseListener(new MouseAdapter(){
public void mouseClicked (MouseEvent evt) {
verdeMouseClicked(evt);
}
});
naranja=new...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Calculadora cientifica
  • Calculadoras Cientificas
  • Calculadora Cientifica
  • Calculadoras científicas
  • Calculadora cientifica
  • Codigo de calculadora con php
  • Codigo de calculadora en java
  • Codigo c# para calculadora

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS