//RetrieveText.java
import java.awt.*;
import java.applet.*;
public class RetrieveText extends Applet
{
Label label;
TextField textField;
public void init()
{
//Membuat label;
label = new Label ("Masukkan teks kemudian tekan Enter...!");
textField = new TextField(20);
add(label);
add(textField);
}
public void paint (Graphics g)
{
g.drawString ("Anda menuliskan : ", 30, 80);
//Mengambil input String
String s = textField.getText();
g.drawString(s, 30, 100);
}
public boolean action(Event event,Object arg)
{
repaint();
return true;
}
}
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar