---
title: "Ext.Window 独孤九剑-第二式"
author: "hwpok"
date: "2008-10-22T09:12:00Z"
tags: []
slug: "ext-window"
draft: false
lastmod: "2008-10-22T09:12:00Z"
id: 615808
url: "https://hwpok.iteye.com/blog/615808"
---

&lt;!--&lt;br /&gt; &lt;br /&gt; Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt; http://www.CodeHighlighter.com/&lt;br /&gt; &lt;br /&gt; --&gt;&lt;%@ page contentType="text/html;charset=UTF-8"%&gt;  
&lt;html&gt;  
    &lt;head&gt;  
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;  
        &lt;title&gt;Ext.Window&lt;/title&gt;  
        &lt;link rel="stylesheet" type="text/css"  
            href="/ext/resources/css/ext-all.css" /&gt;  
        &lt;script type="text/javascript" src="/ext/adapter/ext/ext-base.js"&gt;&lt;/script&gt;  
        &lt;script type="text/javascript" src="/ext/ext-all.js"&gt;&lt;/script&gt;  
        &lt;script type="text/javascript"&gt;  
             function myWindow()  
             {  
                 var tabPanel=new Ext.TabPanel(  
                         {  
                             width:300,  
                             height:200,  
                             items:[  
                                    {  
                                        contentEl:"tabOne",//标签页的页面元素id(加入你想显示的话)  
                                        title:"HuyVanpull's Panel",  
                                         activeTab:1, //当前激活标签  
                                         height:30,  
                                         closable:true  
                                    },  
                                    {  
                                        contentEl:"tabTwo",//标签页的页面元素id(加入你想显示的话)  
                                        title:"Hui Wanpeng's Panel",  
                                         height:30,  
                                         closable:true  
                                    }

                                  ]  
                         });  
                //window组件，它继承自pane.  
                var win=new Ext.Window(  
                        {  
                               contentEl:"container",  
                               width:300,  
                               height:200,  
                               items:tabPanel,  
                               plain:true,//true则主体背景透明，false则主体有小差别的背景色，默认为false  
                               title:"My Window",  
                               buttons:\[{text:"OK"},{text:"CANCEL",handler:function(){win.close();}}],  
                               buttonAlign:"center",  
                               collapsible:true  
                        });  
                win.show();  
             }  
             Ext.onReady(myWindow);   
        &lt;/script&gt;  
    &lt;/head&gt;  
    &lt;body&gt;  
        &lt;div id="container"&gt;&lt;/div&gt;  
        &lt;div id="tabOne" class="x-hide-display"&gt;  
            i am Huyvanpull!  
        &lt;/div&gt;  
        &lt;div id="tabTwo" class="x-hide-display"&gt;  
            i am Hui Wanpeng!  
        &lt;/div&gt;  
    &lt;/body&gt;  
&lt;/html&gt;