HELP: How to add one more BUTTON dynamically?
Hi Friends,
I wanna add a new button once if I click the other button, say called ADD, in my applet. So I wrote the following code,
Panel create()
{
Button b = null;
b = new Button("button_" + listOfButtons.size());
b.addActionListener(listener);
add("North", b);
listOfButtons.add(b);
doLayout();
System.out.println("No of Buttons: " + listOfButtons.size() + "\n");
return this;
}
The function create() will be called when I clicked the button 'ADD'. There is no error here.
But the display did not change yet. There is only one button created in init. But it shows that the Vector listOfButtons can store buttons.
What should I do to have a screen of dynamic array of buttons?
Law. T.

