I want to replace a JTextField by a JComboBox in a JPanel when some
button is clicked. I tried using a JComponent object common to both
the JTextField and the JComboBox like this:
JComponent jtfOrJcb = null;
jtfOrJcb = new JTextField("...");
...When handling an event...
jtfOrJcb = new JComboBox(...);
but that didn't work. I tried repaint() for all panels but the
JTextField just remained there i.e. wasn't replaced by JComboBox.
Did anyone encounter the same problem.
If anyone knows what to do or has a clue on what's goin on then
please tell me.