this is my code and when I run this example it gives NullPointerException
could you help me please to find the error or why I've got this exception !
my code :
public class Frame extends JFrame
{
public Frame()
{
JLabel label;
label.setText("test");
add(label);
setSize(200,200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args)
{
new Frame().setVisible(true);
}
}