I made a frame and added a desktop pane (dp_1) to it. Then I created a separate internal jframe form (Inj) and assigned this code to a button in frame form (main).
Inj inj = new Inj();
dp_1.add(inj);
inj.setVisible(true);
It works fine. Then I created another internal jframe form(Inj_1). I want to set it visible by a button in Inj. I did trying the same code, but there comes an error.
Error is ;
error: dp_1 has private access in NewJFrame
*() include the variable name.
You should provide a public method in the class that owns that variable and let it modify its own state.
You can also use reflection if you must, but I don’t recommend it.