home *** CD-ROM | disk | FTP | other *** search
Java Source | 2000-01-31 | 622 b | 32 lines |
- import java.awt.*;
- import javax.swing.*;
-
- public class Principal extends Frame
- {
- private JButton boton;
-
- public Principal()
- {
- super ();
-
- // Crear el boton
- boton = new JButton ("Esto es un boton");
- // Crear el listener
- setLayout ( new BorderLayout() );
- Oyente oyente = new Oyente();
- boton.addActionListener( oyente );
- boton.addMouseMotionListener( oyente );
- reshape(50,50,300,340);
-
- // A±adir boton
- this.add ( boton );
-
- validate ();
- setVisible ( true );
- }
-
- public static void main ( String[] main )
- {
- new Principal ();
- }
- }