0
public class Login extends JFrame {
    private JPanel panel1;
    private JButton btnLogin;
    private JTextField txtEmail;
    private JPasswordField txtPassword;
    public static Users users;

    public Login(){

        initComponent();
    }
private void initComponent(){
        setContentPane(panel1); //here is the problema, Why?
        setSize(600,400);
        setDefaultCloseOperation(3);
        setLocationRelativeTo(null);
    }

![The image is on the link :(][1] [1]: https://i.stack.imgur.com/ar5u8.jpg

XxHaRuToxX
  • 39
  • 6
  • do you write to panel1 anywhere? – Andi Mar 21 '21 at 05:51
  • yes.. i have everything ok when i run in java project without Maven, because ia want to convert the java project to Maven project and then make a jar executable. – XxHaRuToxX Mar 21 '21 at 05:56
  • the link of the image https://i.stack.imgur.com/ar5u8.jpg – XxHaRuToxX Mar 21 '21 at 05:58
  • 1
    Does this answer your question? [What is a NullPointerException, and how do I fix it?](https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Savior Mar 21 '21 at 06:03
  • Hi, Please paste the stack dump into the question. It will make it easier for people to help. – devdanke Mar 21 '21 at 09:48
  • Looks like some image cannot be found. If you set a debug point on the line 18, you will be able to go into the initComponent() method and hopefully see the the name of the icon file that it is looking for. My guess is that your pom.xml is not copying the image you need into the final jar. Good luck! – devdanke Mar 21 '21 at 09:52
  • I was whaching the code and i saw that when i deleted the image, it is runnig, but when a insert into the swing the image again, i get the same error again. why is it??? – XxHaRuToxX Mar 21 '21 at 18:56
  • How can icopy the images into the pom.xml??? i think it is the problem. thank you? – XxHaRuToxX Mar 21 '21 at 19:36

0 Answers0