if you like to have the function to double click on a header and then the window should maximize and restore then is this helper class for you:

WindowMaximizeOnHeaderDoubleclick

code improvements are welcome :-)


PHP Code:
package org.yournamehere.client.gui.components;

import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.Window;
import com.google.gwt.user.client.Event;

/**
 *
 * @author anonym
 */
public class WindowMaximizeOnHeaderDoubleclick {

    private 
WindowMaximizeOnHeaderDoubleclick() {
    }

    
/**
     * 
     * @param window
     */
    
public static void applyTo(final Window window) {
        
window.getHeader().addListener(Events.Render, new Listener<BaseEvent>() {

            public 
void handleEvent(BaseEvent be) {
                
window.getHeader().el().addEventsSunk(Event.ONDBLCLICK);
            }
        });
        
window.getHeader().addListener(Events.OnDoubleClick, new Listener<BaseEvent>() {

            public 
void handleEvent(BaseEvent be) {
                if (
window.isMaximized()) {
                    
window.restore();
                } else {
                    
window.maximize();
                }
            }
        });
    }

usage:

PHP Code:
package org.yournamehere.client.forum.code.snippets;

import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.Window;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Event;

/**
 *
 * @author anonym
 */
public class ForumThread76937 implements EntryPoint {

    public 
void onModuleLoad() {
        
Window window = new MyFormWindow();
        
window.show();
    }

    class 
MyFormWindow extends Window {

        
MyFormWindow() {
            
setMaximizable(true);
            
add(new Html("Test"));

            
WindowMaximizeOnHeaderDoubleclick.applyTo(this);
        }
    }