Lenguaje de Prgramacion II
Profesor: Quiñones Nieto, Yamil Página 3
Codigo
Fuente
import java.awt.*;import java.applet.Applet;// Demostracion de uso del FlowLayoutpublic class AwtFlow extends Applet {Button boton1,boton2,boton3;public void init() {// Simplemente a¤adimos tres botones al Applet, y como el// FlowLayout es el que se usa por defecto, ni nos// molestamos en indicar que ese es el que queremosboton1 = new Button( "Aceptar" );boton2 = new Button( "Abrir" );boton3 = new Button( "Cerrar" );add( boton1 );add( boton2 );add( boton3 );}}
import
javax.swing.JFrame;
import
javax.swing.*;
/**
*
*
@author
usuario
*/
public
class
FlowLayout
extends
JFrame{
JButton
boton;
public
FlowLayout()
{
setTitle("El
titulo");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocationRelativeTo(null);
Leave a Comment