HI, I want to add a button(button3) in verticalpanel on clicking of
button1. I wrote the code as below but it is not working. The button3
is not getting displayed(or added to the verticalpanel). Can anybody
tell me what is wrong with the code?
public class myExample implements EntryPoint {
private Panel verticalPanel = new Panel();
private Button button3; //= new Button("New 1");
private Button button1 = new Button("Button1", new
ButtonListenerAdapter() {
public void onClick(Button button, EventObject e) {
//button2.setText("2changed");
verticalPanel.add(button3);
}
});
private Button button2 = new Button("Button2", new
ButtonListenerAdapter() {
public void onClick(Button button, EventObject e) {
button1.setText("1changed");
}
});
public void onModuleLoad() {
button3 = new Button("New 1");
verticalPanel.setLayout(new VerticalLayout(10));
verticalPanel.add(button1);
verticalPanel.add(button2);
RootPanel.get().add(verticalPanel);
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---