LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class PRUEBA extends JApplet implements ActionListener
{
JTextField t1,t2;
JButton b1,b2;
public void init()
{
Container c=getContentPane();
c.setLayout(new FlowLayout());
t1=new JTextField(20);
t2=new JTextField(20);
b1=new JButton("NOMBRE");
b2=new JButton("DIRECCION");
b1.addActionListener(this);
b2.addActionListener(this);
c.add(t1);
c.add(t2);
c.add(b1);
c.add(b2);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
t1.setText("RODRIGO VILLANUEVA");
}
if(e.getSource()==b2)
{
t2.setText("ARAGON");
}
}
}
Suscribirse a:
Enviar comentarios (Atom)
0 comentarios:
Publicar un comentario