I have no idea whats wrong here, i am fairly new to java..
heres my code....
private JPanel pnlLogin, pnlFinalLogin,pnlUser, pnlPass = new JPanel(new BorderLayout());
btnLogin = new JButton("Login");
lblUser = new JLabel("Username:");
lblPass = new JLabel("Password:");
pnlUser.add(lblUser, BorderLayout.WEST);
//pnlUser.add(txtUser);
pnlPass.add(lblPass, BorderLayout.WEST);
//pnlPass.add(txtPass);
pnlLogin.add(pnlUser, BorderLayout.WEST);
pnlLogin.add(pnlPass, BorderLayout.CENTER);
pnlLogin.add(btnLogin, BorderLayout.EAST);
mainFrame.setSize(800, 400);
mainFrame.getContentPane().setLayout(new BorderLayout());
mainFrame.getContentPane().add(pnlLogin, BorderLayout.NORTH);
error
Exception in thread "main" java.lang.NullPointerException
at package1.GUI.show(GUI.java:25)
at package1.Program.main(Program.java:20)
line 25 is
pnlUser.add(lblUser, BorderLayout.WEST);
what am i doing wrong?
note: only added relevant code... reason being why line 25 is different
Thanx
Phoenix911