how to getJTabbedPane in other class
Dear All,
I have the main class which declared the JFrame...called AFMB.java
------AFMB.JAVA-------------------
Code:
public AFMB()
{
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setup();
pack();
addWindowListener(new WindowEventHandler());
show();
}
private void setup() {
setJMenuBar(fsu.setupMenuBar());
contentPane.add(tabbedPane, BorderLayout.CENTER);
tabbedPane.addTab("Login", sp.showPane());
}
the other class called:
-------DATABASE.java----------
Code:
{
String param3 = r.getString(3).trim();
System.out.println(param3);
if (param3.equals("accounts"))
{
foundrec = 1;
tabbedPane.removeTabAt(0);
tabbedPane.addTab("My Database", sp4.showpane4());
}
else if(param3.equals("principal"))
{
foundrec = 1;
//will show other JTabbedPane....
}
}
I would like to Remove the Login Tabbed (0), and display the new tabbed("My Database")...but it does not work..
Please help how to add the new tab from the main class.AFMB...
Thank you for the help...