Documentos de Académico
Documentos de Profesional
Documentos de Cultura
TECNOLÓGICO
Ingeniería en Sistemas Computacionales Tecnológico
NACIONAL
DE MÉXICO de la Costa Grande
Unidad II “Aplicaciones web”
java.security.AllPermision Otorga todos los permisos, por lo tanto debe ser utilizada sólo durante
pruebas.
java.applet Reference
In this chapter:
• Introduction to the Reference Chapters
• Package diagrams Introduction to the Reference Chapters
The preceding seventeen chapters cover just about all there is to know about AWT. We have tried to
organize them logically, and provide all the information that you would expect in a reference manual—
plus much more in the way of examples and practical information about how to do things effectively.
However, there are many times when you just need a reference book, pure and simple: one that’s
organized alphabetically, and where you can find any method if you know the class and package that it
belongs to, without having to second guess the author’s organizational approach. That’s what the rest of
this book provides. It’s designed to help you if you need to look something up quickly, and find a brief
but accurate summary of what it does. In these sections, the emphasis is on brief; if you want a longer
description, look in the body of the book.
Within each package, classes and interfaces are listed alphabetically. There is a description and a
pseudo-code definition for each class or interface. Each variable and method is listed and described.
New Java 1.1 classes are marked with a black star (_), as are new methods and new variables. Of course,
if a class is new, all its methods are new. We didn’t mark individual methods in new classes. Methods
that are deprecated in Java 1.1 are marked with a white star (✩).
Inheritance presents a significant problem with documenting object-oriented libraries, because the bulk
of a class’s methods tend to be hiding in the superclasses. Even if you’re very familiar with object-
oriented software development, when you’re trying to look up a method under the pressure of some
deadline, it’s easy to forget that you need to look at the superclasses in addition to the class you’re
interested in itself. Nowhere is this problem worse than in AWT, where some classes (in particular,
components and containers) inherit well over 100 methods, and provide few methods of their own. For
example, the Button class contains seven public methods, none of which happens to be setFont().
The font used to display a button’s label is certainly settable—but to find it, you have to look in the
superclass Component. So far, we haven’t found a way around this problem. The description of each
class has an abbreviated class hierarchy diagram, showing superclasses (all the way back
to Object), immediate subclasses, and the interfaces that the class implements.
Ideally, it would be nice to have a list of all the inherited methods—and in other parts of Java, that’s
possible. For AWT, the lists would be longer than the rest of this book, much too long to be practical, or
even genuinely useful. Someday, electronic documentation may be able to solve this problem, but we’re
not there yet.
Ejemplo: ISCTAPU2EJEM010
Archivo html
<!--
Nombre del programa: ISCTAPU2EJEM010.html
Fecha de programacion: 20 de Abril de 2018
Autor :
Objetivo : Carga el appet de java ISCTAPU2EJEM010.class
-->
<HTML>
<HEAD>
<TITLE>Topicos Avanzados de programación </TITLE>
</HEAD>
<CENTER>
<h1>
UNIDAD 2
</h1>
<h3>
"Desarrollo de aplicaciones para internet"
</h3>
<h5>
"Ejemplo -> ISCTAPU2EJEM010"
</h5>
<APPLET
CODE = "TAPU2EJEM010.class"
WIDTH = 800
HEIGHT = 50>
</APPLET>
</CENTER>
</HTML>
Archivo java
/*************************************************************************************
Nombre del programa: ISCTAPU2EJEM010.java
Fecha de programacion: 20 de Abril de 2018
Autor :
Objetivo : Ejemplo de visualizacion de CampodeTexto mediante la pulsacion de un Boton
que utiliza la combinación atraves de los escuchadores action y el handleEvent
**************************************************************************************/
import java.awt.*;
import java.applet.*;
Etiqueta1.setBackground(new Color(153,255,0));
Etiqueta1.setFont(TipodeLetra);
add(Etiqueta1);
Boton1.setBackground(new Color(255,255,0));
add(Boton1);
setBackground(new Color(255,255,255));
}
if (evt.target == Boton1){
Texto=CampodeTexto1.getText();
Etiqueta1.setText(Texto);
}else
if (evt.target == CampodeTexto1){
Texto=CampodeTexto1.getText();
Etiqueta1.setText(Texto);
}
return true;
}
if (evt.target == CampodeTexto2){
Texto=CampodeTexto2.getText();
Etiqueta1.setText(Texto);
}
return super.handleEvent(evt);
}
}
Resultado
Ejercicio ISCTAPU2EJER010
En base a los ejemplos, ejercicios y practicas 7, 8, 9 y 10 desarrolle una aplicacion que:
1) Capturar en cajas de texto de libreria swing, los siguientes campos y en el orden siguiente
a) Nombre
b) Apellido paterno
c) Apellido materno
d) Nombre de la carrera
e) plan de la carrera
f) Numero de control
g) Semestre ejemplo: Enero – Junio 2016
h) Semestre que cursa ejemplo: 4 semestre
Instructor: Carlos Baltazar Oliva Enero – Junio 2018 62
TOPICOS AVANZADOS DE PROGRAMACIÓN Instituto
TECNOLÓGICO
Ingeniería en Sistemas Computacionales Tecnológico
NACIONAL
DE MÉXICO de la Costa Grande
Unidad II “Aplicaciones web”
Practica TAPU2PRAC010
1) En base al ejemplo TAPU2EJEM010, desarrole la siguiente practica que realice losiguiente:
2) El objeto Accion que es un botón debe estar en medio de los objetos Campo de de texto 1 y Campo de texto 2,
como lo muestra la siguiente figura
6) El objeto llamado destino debe quedar al final de la línea como lo muestra la Siguiente figura
8) Todos los objetos deben quedar en una misma línea imaginaria como lo muestra
La siguiente figura
Subir el ejemplo ISCTAPU2EJEM011.java, para que lo tome como parte del examen,
Practica
El alumno deberá modificar el ejemplo ISCTAPU2EJEM011, para que:
a) El mensaje se debe teclear como parte del inicio del applet
b) El applet deberá contener objetos que permita cambiar el tipo de letra
c) El applet deberá contener objetos que permita aumentar o diminuir el tamaño de la letra
d) El applet deberá contener objetos que permita aumentar o disminur la velocidad de la animación
e) El applet deberá contener objetos que permita direccionar a la izquierda o derecha el movimiento