I am working on a project basically a log in screen, all is well but one icon is failing to show up, the code is as follows:
private JLabel lblIconSilhouette = new JLabel();
private Icon IconSilhouette = new ImageIcon("C:\\Users\\Bryan\\Documents\\ModSimIcons\\silhouette.png");
panelRight.setLayout(new GridBagLayout());
panelRight.setBackground(new Color(164,74,74,255));
panelRight.setPreferredSize(new Dimension(screenWidth/2,screenHeight));
txtStudentNumber.setPreferredSize(new Dimension(150,25));
txtPassword.setPreferredSize(new Dimension(150,25));
btnEnter.setPreferredSize(new Dimension(100, 25));
//this is the icon i have trouble displaying
lblIconSilhouette.setIcon(IconSilhouette);
lblIconSilhouette.setPreferredSize(new Dimension(400, 300));
grid.gridx=1;
grid.gridy=0;
panelRight.add(lblIconSilhouette,grid);
grid.gridx=1;
grid.gridy=2;
panelRight.add(txtStudentNumber,grid);
grid.gridx=1;
grid.gridy=3;
panelRight.add(txtPassword,grid);
grid.gridx=1;
grid.gridy=4;
panelRight.add(btnEnter,grid);