I know this question has been asked many times, but I can't get any of the answers to work for me. here is the code produced by netbeans for my image:
jLabel2 = new javax.swing.JLabel();
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pathtomastery/pathToMastery.png"))); // NOI18N
progressPanel.add(jLabel2);
jLabel2.setBounds(130, 20, 460, 80);
What can I add to this code to make my image resize to fit the size of the label?