package AWT;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.TextField;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class TextfieldTest {
public static void main(String[] args) {
Frame f=new Frame();
f.setTitle("Textfield test");
f.setSize(500,300);
f.setLayout(new FlowLayout());
TextField tf=new TextField("Escribe aqui...");
tf.setBackground(Color.orange);
f.add(tf);
f.setVisible(true);
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
}
No hay comentarios:
Publicar un comentario