I am trying to make a frame and add a text field inside it.
For that I used JTextField
. But it's not appearing.
Code
import java.awt.*;
import javax.swing.*;
class Tst
{
JFrame f;
JTextField tf;
public Tst()
{
f=new JFrame();
tf=new JTextField(10);
f.setSize(400,400);
f.add(tf);
f.setLayout(null);
f.setVisible(true);
}
public static void main(String s[])
{
new Tst();
}
}