I am lost, can you please help?
I am trying to add a jPanel
from a another class into a different file into a JTabbedPane
in JFrame
file.
Here is what I have so far.
jPanel1 = new javax.swing.JPanel();
One party needs a reference to the other in some way, for example, in your "other" class, you could provide a getter method...
public class OtherClass ... {
public JPanel getComponent() {
//...
}
}
Then in your main UI, you could use the instance of OtherClass
to get a reference to the JPanel
...
tabbedPane.addTab("My Awesome Tab", instanceOfOtherClass.getComponent());
But this is all hypernethtical and is just one possible solution...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.