Hi,
I am trying to move a FormPanel to the be at the center of the screen
and I am having an issue where I have to explicitly resize the window
the first time to make it move to the center.
Here is my code snippet.
I am using AbsoluteLayout and using the onBodyResize to monitor window
resizing.
LoginPanel is a Composite and is child of a panel that has a
FitLayout.
This is a problem *ONLY ON FIREFOX 2.0 and 3.0 *.
Simulator and IE works fine.
What am I missing ?
Regards,
/**
-------------------------------------------------
Code--------------------------------------------------------------------------
*/
public LoginPanel(WebApp controller) {
super(controller);
_parentPanel = new Panel();
_parentPanel.setLayout(new AbsoluteLayout());
_parentPanel.setBorder(false);
//add center panel
_formPanel = new FormPanel();
_formPanel.setFrame(true);
_formPanel.setWidth(400);
_formPanel.setHeight(120);
_formPanel.setTitle("Login");
_email = new TextField("Email", "Email", 230);
_email.setAllowBlank(false);
_formPanel.add(_email);
_password = new TextField("Password", "Password", 230);
_password.setAllowBlank(false);
_password.setPassword(true);
_formPanel.add(_password);
_login = new Button("Login");
_formPanel.addButton(_login);
_login.addListener(new ButtonListenerAdapter() {
public void onClick(Button button, EventObject e) {
Login();
}
});
_cancel = new Button("Clear");
_formPanel.addButton(_cancel);
_cancel.addListener(new ButtonListenerAdapter() {
public void onClick(Button button, EventObject e) {
ClearFields();
}
});
_parentPanel.add(_formPanel, new AbsoluteLayoutData(0,0));
_parentPanel.setMonitorResize(true);
_parentPanel.addListener(new PanelListenerAdapter() {
public void onBodyResize(Panel panel, java.lang.String
width,
java.lang.String height) {
ResizeForm();
}
});
_email.focus();
this.initWidget(_parentPanel);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" 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/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---