隨筆-88  評論-77  文章-48  trackbacks-0
          ??? /**
          ???? * 方法名稱:setShell<p>
          ???? * 方法功能:設(shè)置瀏覽器顯示居中和瀏覽器的大小,默認(rèn)為800*600<p>
          ???? * 參數(shù)說明:Shell<p>
          ???? * 返回:<p>
          ???? * 作者:李明
          ???? * 日期:2006年3月10日
          ???? */
          ??? public void setShell(Shell shell)
          ??? {
          ??????? shell.setSize(800, 600);
          ??????? int width = shell.getMonitor().getClientArea().width;
          ??????? int height = shell.getMonitor().getClientArea().height;
          ??????? int x = shell.getSize().x;
          ??????? int y = shell.getSize().y;
          ??????? if(x > width)
          ??????? {
          ??????????? shell.getSize().x = width;
          ??????? }
          ??????? if(y > height)
          ??????? {
          ??????????? shell.getSize().y = height;
          ??????? }
          ??????? shell.setLocation((width - x) / 2, (height - y) / 2);
          ??? }
          posted on 2006-04-28 11:21 崛起的程序員 閱讀(331) 評論(1)  編輯  收藏 所屬分類: java

          評論:
          # re: SWT技巧薈萃1-設(shè)置居中 2006-11-22 17:36 | Tom[匿名]
          謝謝  回復(fù)  更多評論
            
          主站蜘蛛池模板: 施秉县| 宾阳县| 柳林县| 徐水县| 克东县| 师宗县| 岳阳市| 同德县| 襄樊市| 岚皋县| 临沂市| 正安县| 长丰县| 韶关市| 新河县| 辽中县| 新泰市| 铅山县| 内乡县| 昆山市| 常熟市| 磴口县| 仁布县| 龙陵县| 资源县| 偃师市| 民权县| 木兰县| 丰宁| 五寨县| 松潘县| 桦南县| 子长县| 广饶县| 紫阳县| 山东| 清丰县| 聂拉木县| 阿拉善盟| 万盛区| 波密县|