Sie sind auf Seite 1von 10

DEPARTAMENTO DE ENERGÍA Y MECÁNICA

CARRERA DE INGENIERÍA AUTOMOTRIZ

INFORME DE LABORATORIO No. 30

ASIGNATURA: CÓDIGO: NRC: NIVEL: SEMANA CLASE: DURACIÓN:


PROGRAMACION II COMP15083 2099 II XII 6 HORAS
DEPARTAMENTO: CARRERA: ÁREA DEL CONOCIMIENTO: TEMA:
ENERGÍA Y MECÁNICA INGENIERÍA PROGRAMACIÓN APPLETS PROYECTO
AUTOMOTRIZ
DOCENTE: ALUMNO: FECHA REALIZACIÓN: EJE DE FORMACIÓN:
ING. LUIS ALBERTO GUERRA PEÑA OBACO RONNY 6-JULIO-2016 PROFESIONAL
CRUZ Msc ANTONIO FECHA DE ENTREGA:
11-JULIO-2016

A. FUNDAMENTACIÓN: APPLETS PROYECTO

APPLETS PROYECTO

los applets son pequeños programas escritos en lenguaje Java, diseñados para ser ejecutados
desde internet, que podemos colocar en nuestro servidor, junto con el resto de ficheros que
componen un sitio Web (documentos HTML, ficheros de imagen, sonido, etc.) para lograr múltiples
efectos con texto, imágenes, sonidos, etc.

El uso de applets en Java llegó a ser muy conveniente ya que el código es independiente del sistema
operativo en que se esté corriendo el navegador, sin importar si se trata de una PC con Windows,
un Mac o una computadora con alguna de las variantes de Linux. El código de un applet es ejecutado
por el navegador mismo, usando lo que se llama la máquina virtual Java (JVM, por sus siglas en
inglés: Java Virtual Machine).

Algunos ejemplos de la funcionalidad para la que se utilizan applets son:

 Funciones especializadas, como por ejemplo, applets para calcular el valor del ángulo
inscrito en una circunferencia y circuncentro de un triángulo.
 Mostrar secuencias de imágenes y agregar efectos visuales.
 Mostrar imágenes con sonidos y agregar efectos sonoros.
 Permitir la presentación de gráficos interactivos, reaccionando a acciones que se toman con
el mouse sobre el gráfico.
 Animaciones de textos y efectos especiales sobre los mismos.
 Crear diagramas y gráficas, como por ejemplo la clásica gráfica de rebanadas de pastel.
 Juegos sencillos.

B. DESCRIPCIÓN:
Éste laboratorio está formado por 1 ejercicio:

1. Diseñe un applet relacionado a su proyecto

C. OBJETIVO:
Conocer el funcionamiento correcto de las applets

D. PROYECTO:
Analizar el funcionamiento de las applets
E. TAREAS A REALIZAR:
Realizar los algoritmos solicitados.

F. ANÁLISIS:

ANÁLISIS DE DATOS:

class javax.swing.JApplet

class Ventana

private bGuardar JButton;


private bLimpiar JButton;
private bSalir JButton;
private jLabel1 jLabel;
private jLabel2 jLabel;
private jLabel3 jLabel;
private jLabel4 jLabel;
private jLabel5 jLabel;
public static tMarca jTextField;
public static tSerie jTextField;
public static tTipo jTextField;
public static tMateria jTextField;
public static tConductos jTextField;

class Guardar

private marca String;


private serie String;
private tipo String;
private material String;
private conductos String;

ANÁLISIS DE FUNCIONES:

class javax.swing.JApplet

class Ventana
public bGuardarActionPerformed();
public bLimpiarActionPerformed();
public bSalirActionPerformed();
class Guardar

public getMarca();
public getSerie();
public getTipo();
public getMaterial();
public getConductos();
public setMarca();
public setSerie();
public setTipo();
public setMaterial();
public setConductos();
public Datos();
public ImprimirDatos();
public Limpiar();

G. DISEÑO:

DISEÑO LÓGICO:

DISEÑO FÍSICO:
H. IMPLEMENTACIÓN:

package lab51_appletsproyecto2;
import javax.swing.JOptionPane;

/*
* @author PEÑA OBACO RONNY ANTONIO
*/
public class Ventana extends javax.swing.JApplet {
/**
* Initializes the applet Ventana
*/
@Override
public void init() {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVER
E, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVER
E, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVER
E, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVER
E, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the applet */
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
class Guardar{
private String marca;
private String serie;
private String tipo;
private String material;
private String conductos;

public String getMarca() {


return marca;
}
public String getSerie() {
return serie;
}
public String getTipo() {
return tipo;
}
public String getMaterial() {
return material;
}
public String getConductos() {
return conductos;
}
public void setMarca(String marca) {
this.marca = marca;
}
public void setSerie(String serie) {
this.serie = serie;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public void setMaterial(String material) {
this.material = material;
}
public void setConductos(String conductos) {
this.conductos = conductos;
}
public void Datos(){
marca=Ventana.tMarca.getText();
serie=Ventana.tSerie.getText();
tipo=Ventana.tTipo.getText();
material=Ventana.tMaterial.getText();
conductos=Ventana.tConductos.getText();
}
public void ImprimirDatos(){
JOptionPane.showMessageDialog(null,"Marca: "+marca+"\n Serie: "+serie+"\nTipo
Refrigeracion: "+tipo+"\nMaterial Radiador: "+material+"\nTipo de Conductos:"+conductos);
}
public void Limpiar(){
Ventana.tMarca.setText("");
Ventana.tSerie.setText("");
Ventana.tTipo.setText("");
Ventana.tMaterial.setText("");
Ventana.tConductos.setText("");
}
}

/**
* This method is called from within the init() method to initialize the
* form. WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
tMarca = new javax.swing.JTextField();
tSerie = new javax.swing.JTextField();
tTipo = new javax.swing.JTextField();
tMaterial = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
tConductos = new javax.swing.JTextField();
bGuardar = new javax.swing.JButton();
bLimpiar = new javax.swing.JButton();
bSalir = new javax.swing.JButton();

jLabel1.setText("Aire Acondicionado");

jLabel2.setText("Marca Auto");

jLabel3.setText("Serie Auto");

jLabel4.setText("Tipo Refrigeracion ");

jLabel5.setText("Material Radiador");

tMarca.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tMarcaActionPerformed(evt);
}
});

jLabel6.setText("Tipo de Conductos");

tConductos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tConductosActionPerformed(evt);
}
});
bGuardar.setText("Guardar");
bGuardar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bGuardarActionPerformed(evt);
}
});

bLimpiar.setText("limpiar");
bLimpiar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bLimpiarActionPerformed(evt);
}
});

bSalir.setText("Salir");
bSalir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bSalirActionPerformed(evt);
}
});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());


getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tConductos))
.addGroup(layout.createSequentialGroup()
.addComponent(bGuardar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bLimpiar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bSalir)
.addGap(0, 24, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tMaterial))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tTipo))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tSerie))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(tMarca))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(tMarca, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(tSerie, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(tTipo, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(tMaterial, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(tConductos, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15,
Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bGuardar)
.addComponent(bLimpiar)
.addComponent(bSalir))
.addContainerGap())
);
}// </editor-fold>

private void tMarcaActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void tConductosActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void bGuardarActionPerformed(java.awt.event.ActionEvent evt) {


Guardar objetoGuardar=new Guardar();
objetoGuardar.Datos();
objetoGuardar.ImprimirDatos();
}
private void bSalirActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}

private void bLimpiarActionPerformed(java.awt.event.ActionEvent evt) {


Guardar objetoLimpiar = new Guardar();
objetoLimpiar.Limpiar();
}

// Variables declaration - do not modify


private javax.swing.JButton bGuardar;
private javax.swing.JButton bLimpiar;
private javax.swing.JButton bSalir;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
public static javax.swing.JTextField tConductos;
public static javax.swing.JTextField tMarca;
public static javax.swing.JTextField tMaterial;
public static javax.swing.JTextField tSerie;
public static javax.swing.JTextField tTipo;
// End of variables declaration
}

I. PRUEBAS:

PRUEBA DE CAJA NEGRA:

PRUEBA DE CAJA BLANCA:

J. Reporte

REQUERIMIENTOS FUNCIONALES ANÁLISIS DISEÑO IMPLEMENTACIÓN PRUEBAS TOTAL


bGuardarActionPerformed();

bLimpiarActionPerformed();

bSalirActionPerformed();

getMarca();
getSerie();

getTipo();

getMaterial();

getConductos();

setMarca();

setSerie();

setTipo();

setMaterial();

setConductos();

Datos();

ImprimirDatos();

Limpiar();

CALIFICACIÓN

K. RESULTADOS Y CONCLUSIONES:

 Se ha logrado realizar correctamente los algoritmos solicitados utilizando Applets

L. ACTIVIDADES SEGÚN CRONOGRAMA:

TRIGESIMA ENTREGA: 11 de julio de 2016


APPLETS PROYECTO

M. REFERENCIAS BIBLIOGRÁFICAS:

Nombre de la obra: Apletts


Nombre de autor (es): Richard Intriago
Editorial: about
Año de edición: 2014

[online]: http://aprenderinternet.about.com/od/Glosario/g/Applet-
Tema: En-Java.htm
Applets

Das könnte Ihnen auch gefallen