This code is not running and throws an exception
import java.awt.*; class loginwindow extends Frame { loginwindow() { this.setLayout(null); Label l1 = new Label("Username :"); Label l2 = new Label("Password :"); Textfield t1 = new Textfield(20); Textfield t2 = new Textfield(20); Button b1,b2; t2.setEchoChar("*"); b1 = new Button("Submit"); b2 = new Button("Reset"); this.add(l1); this.add(t1); this.add(l2); this.add(t2); this.add(b1); this.add(b2); } public static void main(String args[]) { loginwindow obj = new loginwindow(); obj.setVisible(true); obj.setSize(400,400); obj.setTitle("My log in window"); }