-1

Im trying to display an avatar pic and Theme pic on my Login Form mobile application on CodeName One like that

 Image profilePic = theme.getImage("user-picture.png");
    Image mask = theme.getImage("round-mask.jpg");
    profilePic = profilePic.fill(mask.getWidth(), mask.getHeight());
    Label profilePicLabel = new Label(profilePic, "ProfilePic");
    profilePicLabel.setMask(mask.createMask());

but this errors it display to me :

java.lang.NullPointerException
at Activite.gui.LoginForm.<init>(LoginForm.java:54)

** Exactly On**

        profilePic = profilePic.fill(mask.getWidth(), mask.getHeight());

N.B The Pictures are in the same folder with the My class

Trip toDo
  • 11
  • 1
  • 1
    Either `profilePic` or `mask` is null. Are you sure that the extensions are correct? – Scary Wombat May 10 '22 at 23:36
  • You can place a breakpoint and step over the code. You can inspect the `theme` object which is just a map between keys and values inside it. – Shai Almog May 11 '22 at 04:00

0 Answers0