I’m new in netbeans and java swing, but also confused. I put some JLabel’s from drag and drop in netbeans with some text, and now I want to change that text from the code, and I’m getting error non-static variable can not be referred from static context.
help
FirstFrame f = new FirstFrame();
f.labSifra.setText("aaaa");
I tried this and when I start app JLabel is still with the old text
Because you try to modify your JLabel from
static void mainAnd somewhere in your code generated from NetBeans you have:
If you drop for example JButton into form builder and double click it you will have method:
You can change defualt scope/modifier of jLabel1 by right click over GUI Component then
Properties -> Code -> Variable Modifiers