Hi Rajan,
Thanks a lot for the extra effort. I tried out but

I am enclosing the exact replica of the code. This code is based on the previous sample code. Correct me if i have got the concepts wrong.
Code:
----
public class AdminTabbedPan extends JFrame implements ChangeListener
{
Container container;
JTabbedPane tp;
int count = 0;
public AdminTabbedPan()
{
container= this.getContentPane();
tp = new JTabbedPane();
JPanel panel1 = new JPanel();
JButton button1 = new JButton("button1 panel1");
panel1.add(button1);
JButton button2 = new JButton("button2 panel1");
panel1.add(button2);
JPanel panel2 = new JPanel();
JButton button21 = new JButton("button1 panel2");
panel2.add(button21);
combo = new JComboBox();
String string = ""+ ++count;
tp.addChangeListener(this);
tp.addTab("Add New User",panel1);
tp.setBackgroundAt(0,Color.white);
tp.addTab("Add New MgmtRep QCRep",panel2);
tp.setBackgroundAt(1,Color.white);
container.add(tp);
pack();
setSize(400,400);
}
public void stateChanged(ChangeEvent ce)
{
JTabbedPane tbpane;
tp.repaint();
tbpane = (JTabbedPane) ce.getSource();
int selectedIndex = tbpane.getSelectedIndex();
if (selectedIndex == 0)
{
// new AddUser();
System.out.println("Selected tab is 0");
}
if (selectedIndex == 1)
{
`// IN panel2
// I create the JCombo And display the values // here from the database
class panel2 extends JPanel implements ActionListener
{
JComboBox SelectUserCombo;
ResultSet res;
Connection con;
Statement stm;
public panel2()
{
TitlePanel.add(title);
SelectUserCombo = new JComboBox();
SelectUserCombo.addItemListener(this);
SelectUserCombo.removeAllItems();
try
{
// GET THE DATABASE VALUES
while(res.next())
{
SelectUserCombo.insertItemAt
(res.getString(1),i);
i++;
}
}
catch(Exception ex)
{
}
// add SelectUserCombo to the panel
}// end of constructor panel2()
public void actionPerformed(ActionEvent evt)
{
Object e = evt.getSource();
if (e==SelectUserCombo)
{
}
} // end of actionPerformed
}// end of class panel2
}// end of selectedIndex=2
}// end of state Changed
public static void main(String[] a)
{
AdminTabbedPan ob = new AdminTabbedPan();
ob.show();
}
}// end of class AdminTabbedPan
with warm regards,
Arun.