I made it, and it not run ok

public class Campo extends Composite implements MouseListener {
        private Button btnCerrar;
        private FlexTable tablaPrincipal;
        private VerticalPanel vp;
        private Image imageCerrar;
        private Button btnEditar;
        private TextBox txbCampo;
        private TextBox txbInfoCampo;
        private HTML htmlCampo;
        private HTML htmlInfoCampo;
        private boolean editable = false;
        private String nombreCampo;
        private String valorCampo;
        Campo(String nombreCampo,String valorCampo){
                this.nombreCampo=nombreCampo;
                this.valorCampo=valorCampo;
                tablaPrincipal = new FlexTable();
                imageCerrar = new Image("images/botones/x.png");
                imageCerrar.addClickListener(new ClickListener(){
                        public void onClick(Widget sender){
                                setVisible(false);
                        }
                });
                tablaPrincipal.getFlexCellFormatter().setColSpan(0, 0, 2);
                tablaPrincipal.setWidget(0, 0, imageCerrar);
                tablaPrincipal.getFlexCellFormatter().setHorizontalAlignment(0, 
0,
HorizontalPanel.ALIGN_RIGHT);
                btnEditar = new Button("Editar");
                txbCampo = new TextBox();
                htmlCampo = new HTML("<b>"+nombreCampo+"</b>");
                htmlInfoCampo = new HTML("");
                txbInfoCampo = new TextBox();
                txbInfoCampo.setText(valorCampo);
                tablaPrincipal.setWidget(1, 0, htmlCampo);
                tablaPrincipal.setWidget(1, 1, txbInfoCampo);
                tablaPrincipal.getFlexCellFormatter().setColSpan(2,0,2);
                tablaPrincipal.setWidget(2,0,btnEditar);
                tablaPrincipal.getFlexCellFormatter().setHorizontalAlignment(2, 
0,
HorizontalPanel.ALIGN_CENTER);
                btnEditar.setStyleName("Meztuls-botonPeque");
                txbInfoCampo.setStyleName("Meztuls-editable");
                setWidget(tablaPrincipal);

        }
        public void onMouseDown(Widget sender, int x, int y) {
                // TODO Auto-generated method stub

        }

        public void onMouseEnter(Widget sender) {
                imageCerrar.setVisible(true);
        }

        public void onMouseLeave(Widget sender) {

                imageCerrar.setVisible(false);

        }

        public void onMouseMove(Widget sender, int x, int y) {
                // TODO Auto-generated method stub

        }

        public void onMouseUp(Widget sender, int x, int y) {
                // TODO Auto-generated method stub

        }

}

On 25 sep, 15:57, walden <[EMAIL PROTECTED]> wrote:
> What kind of widget?
>
> If you want to make a composite, you might use a FocusPanel as the
> outer container.  FocusPanel sources click, mouse and mouse wheel
> events, so you can add your listeners to that, and events from inner
> elements will bubble up.
>
> If you just want to instrument some arbitrary Widget with mouse
> events, then extend the Widget, sink the appropriate events when a
> listener gets attached (late-bound event sinking is the model to
> follow now), and override onBrowserEvent to look for and handle the
> new events.
>
> Walden
>
> On Sep 25, 7:54 am,jamer<[EMAIL PROTECTED]> wrote:
>
> > Hi
> > I want create a widget whith a mouselistener event, and it is not a
> > extends to DialogBox or Image
> > How i can?
>
> > Thank you!!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to