This has to be a pretty basic question but I cannot for the life of me find anything via Google or this site about how to do this and it\'s really frustrating because I\'ve
Most widgets and panels in GWT implements the HasAttachHandlers interface. Adding an AttachEvent.Handler to these widgets/panels is equivalent to defining a function to run onload.
An example:
FlowPanel mainPanel = new FlowPanel();
mainPanel.addAttachHandler(new AttachEvent.Handler() {
@Override
public void onAttachOrDetach(AttachEvent event) {
// do something
}
});