<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    悄悄成長
    for navigation

    2007年12月19日

    在ecliipse-->preference-->Java--->Debug 設置

    Suspend execution:
    只保留 suspend for breakpoint.

    Hot code replace
    保留: show error when hot code replace failed.
              show error when obsolete code remain after replace.
              replace classfiles containing compilation errors.

    Communication:
    change Debugger timer  to 30000
    Launch timer to 200000

    posted @ 2009-03-10 13:23 Duan Bo Hao 閱讀(435) | 評論 (0)編輯 收藏
     
    The project was not built since its build path is incomplete. The project was not built since its build path is incomplete. Fix the build path then try building this project
    The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

    出現以上訊息的原因是因為你裝了多個版本的jre或jdk的關係。本來Eclipse在建立專案時,會自動參照你的jre路徑,但多個版本就沒辦法了。
    你只能手動建立…
    1. 進入window\preferences\java\Installed JREs
    1)按Add
    2)輸入JRE Name, 例JDK1.5.0.03
    3)JRE home directory, 選擇安裝的路徑
    4)按OK
    2. 進入Project\properties\Java Bulid Path
    1)Add library
    2)選JRE System Library後按Next
    3)選workplace default JRE後按finish...

    posted @ 2008-07-24 10:29 Duan Bo Hao 閱讀(3016) | 評論 (1)編輯 收藏
     

    I composed a code as below:

    package duanbo;

    public class HelloWorld
    {
            
    public static void main(String arg[])
            {
                System.out.println(
    "Hello World");
            }

    }

    The HelloWorld.java was put on root of E: , I excuse the compile/run process :
    E:\>javac HelloWorld.java

    E:\
    >java HelloWorld

    The first step was ok. And throw out "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong name: duanbo/HelloWorld)" at step 2.

    I think may be I should move the HelloWorld.class to E:\duanbo. So did it.

    Redo the up steps. The erroe was same as before.

    After some search, I got the right command.

    E:\>javac HelloWorld.java

    E:\
    >java duanbo.HelloWorld


    posted @ 2008-05-05 14:05 Duan Bo Hao 閱讀(188) | 評論 (0)編輯 收藏
     

    You could add this parameter to find how java class loader work .

    javac -verbose classname.java
    java -verbose classname


    posted @ 2008-05-05 13:31 Duan Bo Hao 閱讀(216) | 評論 (0)編輯 收藏
     

    Under no circumstance, I think, you could speak that :" the java HelloWorld sample is easy."
    We could study a lot in this lesson.

    Let me demo the right code firstly.

    public class HelloWorld
    {
            
    public static void main(String arg[])
            {
                System.out.println(
    "Hello World");
            }

    }

    You should advance some questions about it, or you ...

    1. can the "public" keyword be skip?
    2. can we change the "String arg[]" parameter to "int arg[]"?
    3. does the "void" phrase could be put befor "static", as "public void static mian(String arg[])" ?
    4. could the "arg[]" be modified to other name ?

    Please find the answer to them with search engine.
    posted @ 2008-05-05 13:29 Duan Bo Hao 閱讀(216) | 評論 (0)編輯 收藏
     

    Study tha adapter pattern this morning. Found some tutorial are not as good as I imaged.

    I parse my code about the adapter to demo it.

    Firstly, the object adapter:

    package duanbo.patterns.adapter;

    public class ObjectAdapter
    {
        
    public static void main(String[] args){   
            PutBall pb 
    = new PutBall();   
               
            System.out.println(
    "BasketBall");   
            BasketballBag bb 
    = new BasketballBag();   
            pb.putBalls(bb);   
               
            System.out.println(
    "FootBall");
            FootballBag fb 
    = new FootballBag();   
            BallBag bbag 
    = new BallBag(fb);   
            pb.putBalls(bbag);   
        }

    }


    class BallBag extends BasketballBag
    {
        FootballBag fb;

        
    public BallBag(FootballBag fb)
        
    {
            
    this.fb = fb;
        }


        
    public void putball()
        
    {
            fb.putFootball();
        }

    }


    class BasketballBag
    {
        
    public void putball()
        
    {
            System.out.println(
    "Put in BasketBall.");
        }

    }


    class PutBall
    {
        
    public void putBalls(BasketballBag bb)
        
    {
            bb.putball();
        }

    }


    class FootballBag
    {
        
    public void putFootball()
        
    {
            System.out.println(
    "Put in FootBall.");
        }

    }

    And the second demo: Class Adapter:

    package duanbo.patterns.adapter;

    public class ClassAdapter extends RoundPeg implements ISquarePeg
    {
        
    private RoundPeg roundPeg;

        
    public ClassAdapter(RoundPeg peg)
        
    {
            
    this.roundPeg = peg;
        }


        
    public void insert(String str)
        
    {
            roundPeg.insertIntoHole(str);
        }


    }


    interface IRoundPeg
    {
        
    public void insertIntoHole(String msg);
    }


    interface ISquarePeg
    {
        
    public void insert(String str);
    }


    class SquarePeg implements ISquarePeg
    {
        
    public void insert(String str)
        
    {
            System.out.println(
    "SquarePeg insert():" + str);
        }

    }


    class RoundPeg implements IRoundPeg
    {
        
    public void insertIntoHole(String msg)
        
    {
            System.out.println(
    "RoundPeg insertIntoHole():" + msg);
        }

    }
    posted @ 2008-05-05 13:19 Duan Bo Hao 閱讀(269) | 評論 (0)編輯 收藏
     
            RelativeLayout.LayoutParams relativeParams =
             new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
            relativeParams.addRule(RelativeLayout.CENTER_HORIZONTAL)
                LinearLayout.LayoutParams lineParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,     LinearLayout.LayoutParams.WRAP_CONTENT);

            LinearLayout line = new LinearLayout(this);
            LinearLayout line1 = new LinearLayout(this);

            line.addView(myTt0, lineParams);
            line.addView(myTx0, lineParams);
            line.addView(myTx1, lineParams);
            
            line1.addView(myTx, lineParams);
            
            relativeLayout.addView(line, relativeParams);    //Attention:if the two params are same, the larger layout will be cliped.
            relativeLayout1.addView(line1, relativeParams);
     ////////////////////////////////////////////////////////////
            So the relativeParams should use different ones attach to more than one layouts as below:

            relativeLayout.addView(line, relativeParams);
            relativeLayout1.addView(line1, relativeParams_c);
    posted @ 2008-03-06 19:19 Duan Bo Hao 閱讀(343) | 評論 (0)編輯 收藏
     


        Use SetBackGrounp() target a View component, it will enlange width to the drawable be set.

        So it will influence the Center function.

        Such us:
     
        TextView tx = new TextView(this);
        tx.setText("test"); //the width will be same as the text length.
        tx.setBackGrounp(bitmap); //the width will be enlanged as bitmap's width.

    posted @ 2008-03-06 19:14 Duan Bo Hao 閱讀(230) | 評論 (0)編輯 收藏
     
        最近在搞一個j2me的項目, 目標手機的內存較小, 程序內存分配如果有問題會出現內存泄露.   Java的內存回收由JVM控制,這給開發者的內存管理帶來了方便的同時, 也會帶來一些苦惱(辯證法). 目前用索愛的模擬器進行開發, 它的開發工具還是比較健全了,可以進行內存檢測(盡管很慢), 來找出問題所在.
        現在已知可以預防內存泄露的措施是:
        使用完的對象,特別是大對象即使 置 null, 否則可能陷入循環引用導致JVM不能釋放.
        減小圖片尺寸.
        減小重新new對象.
    posted @ 2007-12-19 13:00 Duan Bo Hao 閱讀(563) | 評論 (0)編輯 收藏
     
    主站蜘蛛池模板: 国产精品成人观看视频免费| 亚洲国产成人久久精品99| 亚洲gv白嫩小受在线观看| 一级毛片**免费看试看20分钟| 永久免费无码网站在线观看| 久久精品国产亚洲AV蜜臀色欲| 91香蕉国产线观看免费全集| 日韩免费a级在线观看| 亚洲精品制服丝袜四区| 好吊色永久免费视频大全| 特级做A爰片毛片免费69| 亚洲AV无码乱码麻豆精品国产| 99久久久国产精品免费无卡顿| 亚洲va成无码人在线观看| 亚洲人成网站免费播放| 中文日韩亚洲欧美制服| 日韩精品内射视频免费观看 | 亚洲?v无码国产在丝袜线观看| 国产亚洲综合视频| 亚洲日韩在线观看| 污污网站免费观看| 亚洲va在线va天堂成人| 日本视频在线观看永久免费| 久久亚洲精精品中文字幕| 青青青国产在线观看免费| 在线观看亚洲专区| 亚洲国产一区二区三区青草影视 | 黄色网页在线免费观看| 亚洲精品无码不卡| 精品国产免费一区二区| sihu国产精品永久免费| 亚洲精品线路一在线观看| 2020国产精品亚洲综合网| 全部免费毛片在线| 久久久久免费精品国产小说| 亚洲高清视频在线| 伊人久久大香线蕉亚洲| 一区二区视频免费观看| 亚洲免费视频网址| 999久久久免费精品国产| 特级无码毛片免费视频|