Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Universidad de Aquino Bolivia
Universidad de Aquino Bolivia
ARTÍCULO DE REVISIÓN
Programación en java Bluej
AUTOR:
Carlos Condori Flores
SUPERVISOR:
LIC. Elizabeth Delgadillo Camacho
1
INDICE
1. Titulo………………………………………………………. 1
2. Indice………………………………………………………. 2
3. Codigo de login …………………………………………… 3
4. Codigo de Proyecto…………………………………………5
5. Codigo de Mensaje………………………………………….8
2
2
CODIGO LOGIN
import javax.swing.*;
import java.awt.event.*;
public class Login extends JFrame implements ActionListener
{
JLabel n1,n2,n3,n4;
JButton b1,b2;
JTextField t1;
JPasswordField t2;
b1 = new JButton("Ingresar");
b1.setBounds(40,210,90,20);
add(b1);
b1.addActionListener(this);
b2 = new JButton("Salir");
b2.setBounds(150,210,90,20);
add(b2); 3
3
b2.addActionListener(this);
}
public void actionPerformed(ActionEvent v)
{
String Usuario = "condori";
String Contraceña = "123";
String pass = new String(t2.getText());
if(v.getSource()==b1)
{
if(t1.getText().equals(Usuario) && pass.equals(Contraceña))
{
Cotizacion f = new Cotizacion();
f.setBounds(300,300,330,700);
f.setVisible(true);
f.setTitle("Cotizacion");
}
else
{
Mensaje f2 = new Mensaje();
f2.setBounds(300,300,290,130);
f2.setVisible(true);
f2.setTitle("Mensaje");
}
}
if(v.getSource()==b2)
{
System.exit(0);
}
}
import javax.swing.*;
public class Cotizacion extends JFrame
{
JLabel n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12;
JTextField t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11;
JTextArea a1;
public Cotizacion()
{
setLayout(null);
n1 = new JLabel("DIA");
n1.setBounds(21,20,50,20);
add(n1);
t1 = new JTextField();
t1.setBounds(15,40,35,25);
add(t1);
n2 = new JLabel("MES");
n2.setBounds(61,20,50,20);
add(n2);
t2 = new JTextField();
t2.setBounds(57,40,35,25);
add(t2);
n3 = new JLabel("AÑO");
n3.setBounds(105,20,50,20);
add(n3);
t3 = new JTextField();
t3.setBounds(99,40,35,25);
add(t3);
n4 = new JLabel("COTIZACION");
n4.setBounds(175,35,90,20);
add(n4);
a1 = new JTextArea();
a1.setBounds(20,80,370,380);
add(a1); 5
5
n5 = new JLabel("TOTAL");
n5.setBounds(240,470,50,20);
add(n5);
t4 = new JTextField();
t4.setBounds(285,470,45,20);
add(t4);
t5 = new JTextField();
t5.setBounds(333,470,55,20);
add(t5);
n7 = new JLabel("Vendedor");
n7.setBounds(205,500,90,20);
add(n7);
t7 = new JTextField();
t7.setBounds(265,500,125,20);
add(t7);
n8 = new JLabel("CONTADO");
n8.setBounds(30,530,90,20);
add(n8);
t8 = new JTextField();
t8.setBounds(25,558,65,42);
add(t8);
n9 = new JLabel("CREDITO");
n9.setBounds(240,530,90,20);
add(n9);
7
7
CODIGO MENSAJE
import java.awt.event.*;
import javax.swing.*;
public class Mensaje extends JFrame implements ActionListener
{
JLabel n1;
JButton b1;
public Mensaje()
{
setLayout(null);
n1= new JLabel("Usuario / Contraceña incorrecta");
n1.setBounds(60,25,190,20);
add(n1);
b1= new JButton("Aceptar");
b1.setBounds(170,60,90,20);
add(b1);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent v)
{
if(v.getSource()==b1)
{
System.exit(0);
}
}
}
8
8