This is my code in java netbeans. I want to display the username get from another form in label and there is errer ...
 String username1; 
 public agent_menu(String username1)
 {
   this.username1=username1;
   System.out.println("user: "+username1);
    jLabel1.setText(username1);
   }
the error:
user: 22
java.lang.NullPointerException
 
    