In una classe JFrame che contiene anche il metodo main, NetBeans non permette di inserire la seguente riga di codice nel metodo main:
jLabel1.setText(percorso);
Errore:
non-static variable jLabel1 cannot be referenced from a static context
Come mai?
Se inserisco la suddetta riga nel costruttore della classe tutto ok![]()