Professional Documents
Culture Documents
Nro. Nombre
1 Acebo Chumacero Magdy Daniela
2 Lozada Fuentes Edson Dennis
3 Miranda Melendres Paul Jesus
4 Mercado Oudalova Erick Denis
5 Saucedo Acarapi Josué Harim Silver
6 Uscamaita Poma Tatiana ELena
import java.applet.Applet;
import java.awt.*;
@Override
public void init() {
this.login = new Label("LOGIN");
this.login.setBackground(Color.BLACK);
this.login.setFont(new Font("TimesRoman", Font.BOLD,
15));
this.login.setForeground(Color.WHITE);
this.pass = new Label("PASSWORD");
this.pass.setBackground(Color.BLACK);
this.pass.setFont(new Font("TimesRoman", Font.BOLD,
15));
this.pass.setForeground(Color.WHITE);
this.txtlogin = new TextField(50);
this.txtpass = new TextField(50);
this.registrar = new Button("REGISTRAR");
this.add(this.login);
this.add(this.txtlogin);
this.add(this.pass);
this.add(this.txtpass);
this.add(this.registrar);
this.setBackground(Color.BLACK);
}
}
2. Applet Registrar en lista.
package Componentes;
import java.applet.Applet;
import java.awt.*;
@Override
public void init() {
this.lab = new Label("ALGO");
this.lab.setBackground(Color.BLACK);
this.lab.setFont(new Font("TimesRoman", Font.BOLD,
20));
this.lab.setForeground(Color.WHITE);
this.lista = new List(10,true);
this.lista.setFont(new Font("TimesRoman", Font.BOLD,
20));
this.boton = new Button("REGISTRAR");
this.txt = new TextField(50);
this.boton.setFont(new Font("TimesRoman", Font.BOLD,
20));
this.add(this.lab);
this.add(this.txt);
this.add(this.lista);
this.add(this.boton);
this.setBackground(Color.BLACK);
}
@Override
public boolean action(Event evt, Object obj) {
if (evt.target == this.boton) {
String cad = this.txt.getText();
this.lista.add(cad);
}
return true;
}
}
3. Applet Copiar Lista
package admcomponentes;
import java.applet.Applet;
import java.awt.Button;
import java.awt.Color;
import java.awt.Event;
import java.awt.Font;
import java.awt.List;
@Override
public void init() {
this.l1 = new List(10,true);
this.l1.setBackground(Color.BLACK);
this.l1.setFont(new Font("TimesRoman", Font.BOLD,
20));
this.l1.setForeground(Color.CYAN);
this.l2 = new List(10,false);
this.l2.setBackground(Color.BLACK);
this.l2.setFont(new Font("TimesRoman", Font.BOLD,
20));
this.l2.setForeground(Color.CYAN);
this.b1 = new Button("COPIAR");
this.l1.add("uno");
this.l1.add("dos");
this.l1.add("tres");
this.add(this.l1);
this.add(this.b1);
this.add(this.l2);
this.setBackground(Color.BLACK);
}
@Override
public boolean action(Event evt, Object obj) {
if (evt.target == this.b1) {
String a[] = this.l1.getSelectedItems();
for (String ele : a) {
this.l2.add(ele);
}
}
return true;
}
}
import java.applet.Applet;
import java.awt.*;
@Override
public void init() {
this.p1 = new Puzzle(3, 3);
this.p2 = new Puzzle(3, 3);
this.p1.setLayout(new GridLayout(3, 3));
this.p2.setLayout(new GridLayout(3, 3));
this.p1.generarFinal();
this.p2.generarInicial();
this.add(this.p1);
this.add(this.p2);
this.setBackground(Color.BLACK);
}
}
package admcomponentes;
import java.awt.Button;
import java.awt.Panel;
public Puzzle() {
}
5.
5. Applet Calculadora
package componentes;
import java.applet.Applet;
import java.awt.*;
@Override
public void init() {
this.la = new Label("CALCULADORA");
this.la.setForeground(Color.BLACK);
this.la.setFont(new Font("sansserif", 1, 50));
this.add(this.la);
this.add(this.txt);
this.add(c);
}
}
package componentes;
import java.awt.*;