Hi i created a swing application which contain combobox on contentpane..My need is when i click any combobox textbox must be removed and replace a combo box.!
txtSearch = new JTextField();
txtSearch.setBounds(10, 11, 107, 22);
getContentPane().add(txtSearch);
txtSearch.setColumns(10);
category = new JRadioButton("Search By Category");
category.setActionCommand("category");
buttonGroup.add(category);
category.setBounds(10, 118, 140, 23);
getContentPane().add(category);
mouse clieck event for category radio button
@Override
public void mouseClicked(MouseEvent arg0) {
getContentPane().remove(txtSearch);
getContentPane().add(comboCategory);
}
mouse click event for title radio button
@Override
public void mouseClicked(MouseEvent e) {
getContentPane().add(txtSearch);
getContentPane().remove(comboCategory);
//getContentPane().add(txtSearch);
}
i already done click event for category radio button.it working perfectly But when i click title radio button it does not change back to text box..!!