Java JFrame Components
Hi All, I've created a JFrame program and now I'm attempting to make a component hidden and then reveal it during the course of the program when the user presses a button. I declared the label as setVisible(false) in the initialisation of the components (the label is also set as private) and then set it as setVisible(true) when the user clicks on the button, however this does not work for some reason. Additionally, if I try to set the label as empty and then use .setText(), it still does not work. The part of the program where I try to set it as setVisible(true) is below. Please could you help me and tell me what I am doing wrong. Thank you for your time. private void btnScanActionPerformed(java.awt.event.ActionEvent evt) { lbl.setVisible(true); scanning(); }