How can I add a JtabbedPane of a class, into a jPanel of another class? Is it possible?
In the 'ConfEmpresa' class I created a container and added the JtabbedPane called 'jTabConfCompany'.
public class ConfEmpresa extends javax.swing.JFrame {
public static Container ct;
public ConfEmpresa() throws SQLException {
ct.add(jTabConfEmpresa);
}
Now in the 'Settings' class I want to show this 'jTabConfCompany' through a one-button action:
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
jPanelPrincipal.add(ConfEmpresa.ct.getComponent(0));
jPanelPrincipal.setVisible(true);
}
When I click the button to show this JTabbedPane it gives the following error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException