Perhaps I wasn't really clear in my last posting yesterday.
I am not using Swing packages yet (stuck with Microsoft J++) and so the changePanel.updateUI(); suggestion is not an option, surely there must be a way without using Swing.
All I want to do is remove a control and then add another to a panel (see case 2 below). However, all that happens is that the original control first disappears with the second control not appearing. (When case 1 runs however the first control reappears???) What am I doing wrong and/or how else can I solve this problem when I want to change controls in a panel? (This is a simplified version of my actual problem of switching panels in the center of a BorderLayout).
Code:
changePanel.add(one, "Center"
...
switch(number) {
case 1:
changePanel.remove(two);
changePanel.add(one);
break;
case 2:
changePanel.remove(one);
changePanel.add(two);
break;
}
...
Many thanks in advance (again)
Kevin
I am not using Swing packages yet (stuck with Microsoft J++) and so the changePanel.updateUI(); suggestion is not an option, surely there must be a way without using Swing.
All I want to do is remove a control and then add another to a panel (see case 2 below). However, all that happens is that the original control first disappears with the second control not appearing. (When case 1 runs however the first control reappears???) What am I doing wrong and/or how else can I solve this problem when I want to change controls in a panel? (This is a simplified version of my actual problem of switching panels in the center of a BorderLayout).
Code:
changePanel.add(one, "Center"
...
switch(number) {
case 1:
changePanel.remove(two);
changePanel.add(one);
break;
case 2:
changePanel.remove(one);
changePanel.add(two);
break;
}
...
Many thanks in advance (again)
Kevin