I have a class Staff which has a JTabbedPane. I want to add a JPanel in the JTabbedPane from another class UpdateProfile (which is on another package). Can anyone help me with that.
I am new to java and recently i moved from gui builder to manual coding so i need a help here. I know its pretty confusing but please take a time to solve this problem.
In the above TabbedPane i want to add the class have constructor as below
Even more confusing without knowing what the error message says. However... if your UpdateProfile class is going to contain a JPanel, as in your constructor code, then it will need a getter method for users of the class (such as your Staff class) to get a reference to that JPanel. Right now you only have a local variable in the constructor which refers to the JPanel, so you'd need to fix the UpdateProfile class to have an instance variable to hold that reference.
Or if the UpdateProfile class is intended to actually be a JPanel, as Piet guesses, then it should extend JPanel instead of creating one.