You'd rather use Composite then subclassing panels.
It would look like
public class MyClass extends Composit {
private VerticalPanel panel = new VerticalPanel();
....
public MyClass() {
initWidget(panel); // really important, this makes panel
underlying wdgt of composite
}
In this case you get 'clear' class, without all the superclass
methods.
You don't want users of your widget to manipulate it contents - it's
widget and it should be opaque. So, exposing add/remove methods is
bad.
On Aug 28, 8:56 am, Michael <[email protected]> wrote:
> You mean something like this?
>
> public class TwoButtonPanel extends DockPanel {
>
> public TwoButtonPanel() {
> Button button1 = new Button("Button 1");
> Button button2 = new Button("Button 2");
> button1.addClickHandler(new ClickHandler(){
> public void onClick(ClickEvent event) {
> button1clicked();
> }
> });
> button2.addClickHandler(new ClickHandler(){
> public void onClick(ClickEvent event) {
> button2clicked();
> }
> });
> add(button1);
> add(button2);
> }
>
> private void button1clicked() {
> }
>
> private void button2clicked() {
> }
> }
>
> On 28 Aug., 10:42, LinuxChata <[email protected]> wrote:
>
> > How to create own widget with two button??
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---