Tweet
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
*
*/
public class text extends Applet implements ActionListener
{
TextField lang,ver;
public void init()
{
Label langx=new Label("Programming Language : ",Label.RIGHT);
Label verx=new Label("Version : ",Label.RIGHT);
lang=new TextField(15);
ver=new TextField(10);
add(langx);
add(lang);
add(verx);
add(ver);
lang.addActionListener(this);
ver.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
repaint();
}
public void paint(Graphics g)
{
g.drawString("Programming Language :"+lang.getText(),10,100);
g.drawString("Version : "+ver.getText(),10,125);
}
}
Output :
Textfield in Java using Applet
Posted by
LAHAUL SETH
~
Textfield in Java using Applet
2012-01-28T10:21:00+05:30
LAHAUL SETH
Java
|
Java Applet
|
Comments
Textfield in Java using Applet
2012-01-28T10:21:00+05:30
LAHAUL SETH
Java
|
Java Applet
|