自由飛翔

          我在仰望,java之上

          統計

          留言簿(2)

          我關注的blog

          閱讀排行榜

          評論排行榜

          2012年9月24日 #

          編碼至高法則-高內聚低耦合

               摘要: 此法則適合所有語言,咱們以JavaScript和Java兩個角度分析一下這個東東。 一、javascript 有這樣的一個頁面,js、css代碼都寫在html頁面中。 例如:gnj.html v1版本Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-...  閱讀全文

          posted @ 2019-09-11 15:59 GavinMiao 閱讀(236) | 評論 (0)編輯 收藏

          Jgoodies FormLayout 小結


          一、列與行的參數都由三個部分組成:對齊方式、固定尺寸、調整方式。
          1.對齊方式:
          1)列對齊有left, center, right, fill.默認fill
          2)行對齊有:top, center, bottom, fill. 其中fill表示填充至整個區域。默認center。
          2.固定尺寸:
          pref表示preferred size,適當大小,即首選尺寸大小。
          min表示minimum size,
          dlu 表示dialog units,
          px, pt, in, mm, cm)分別表示Pixel, Points, Inches, Millimeter, Centimeter。
          3. 調整方式:
          二、CellConstraints:
          cc.xywh(3, 1, 3, 1):表示3列,1行,colspan=3,rowspan=1
          三、FormLayout:
            1.FormLayout layout = new FormLayout(
             new ColumnSpec[]{
               FormSpecs.DEFAULT_COLSPEC,
               FormSpecs.GLUE_COLSPEC,
               FormSpecs.DEFAULT_COLSPEC,
               FormSpecs.GLUE_COLSPEC,
               FormSpecs.DEFAULT_COLSPEC,
               FormSpecs.GLUE_COLSPEC},
             new RowSpec[]{
               FormSpecs.DEFAULT_ROWSPEC,
               FormSpecs.GLUE_ROWSPEC,
               FormSpecs.DEFAULT_ROWSPEC,
               FormSpecs.GLUE_ROWSPEC,
               FormSpecs.DEFAULT_ROWSPEC,
               FormSpecs.GLUE_ROWSPEC
             }
            );
          2.

          FormLayout layout = new FormLayout( 
                  "right:pref, 6dlu, 50dlu, 4dlu, center:50dlu", // columns
                  "pref, 3dlu, pref, 3dlu, pref"); // rows   





          參考文章:
          http://hi.baidu.com/lijunwyf/item/a18d95f719ff01da6225d26f

          posted @ 2012-09-29 11:29 GavinMiao 閱讀(1330) | 評論 (0)編輯 收藏

          Vector淺見

          例子:
          import java.util.*;
          public class TestVector{
           public static void main(String[] args){
            Vector v = new Vector();
            v.add(null);
            v.add(new Integer(1));
            v.add("123");
            
            for(Enumeration e = v.elements();e.hasMoreElements();){
             System.out.println(e.nextElement());
            }
            v.insertElementAt("insert",2);
            v.setElementAt("insert",0);
            
            for(Enumeration e = v.elements();e.hasMoreElements();){
             System.out.println(e.nextElement());
            }
            
           }
          }

          結果:
          null
          1
          123

          insert
          1
          insert
          123
           
          結論:
          vector中可以放入null;
          vector可以放入不同類型的對象;
          vector是同步的容量自增長的向量;

          posted @ 2012-09-24 08:49 GavinMiao 閱讀(324) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 镇坪县| 元氏县| 壤塘县| 涡阳县| 泰顺县| 贡山| 石屏县| 社旗县| 肥东县| 南川市| 建平县| 广河县| 惠安县| 长寿区| 彩票| 长海县| 枞阳县| 成武县| 洪江市| 岳阳县| 新化县| 龙海市| 大兴区| 荥经县| 秭归县| 禹州市| 新建县| 呼图壁县| 额敏县| 长白| 察隅县| 阳朔县| 石狮市| 宁强县| 漳州市| 博白县| 太白县| 土默特右旗| 汉阴县| 黎城县| 莱西市|