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

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

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

    悄悄成長(zhǎng)
    for navigation

    2009年3月10日

    在ecliipse-->preference-->Java--->Debug 設(shè)置

    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 閱讀(441) | 評(píng)論 (0)編輯 收藏

    2008年7月24日

    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

    出現(xiàn)以上訊息的原因是因?yàn)槟阊b了多個(gè)版本的jre或jdk的關(guān)係。本來(lái)Eclipse在建立專(zhuān)案時(shí),會(huì)自動(dòng)參照你的jre路徑,但多個(gè)版本就沒(méi)辦法了。
    你只能手動(dòng)建立…
    1. 進(jìn)入window\preferences\java\Installed JREs
    1)按Add
    2)輸入JRE Name, 例JDK1.5.0.03
    3)JRE home directory, 選擇安裝的路徑
    4)按OK
    2. 進(jìn)入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 閱讀(3022) | 評(píng)論 (1)編輯 收藏

    2008年5月5日

    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 閱讀(191) | 評(píng)論 (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 閱讀(219) | 評(píng)論 (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 閱讀(219) | 評(píng)論 (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 閱讀(272) | 評(píng)論 (0)編輯 收藏

    2008年3月6日

            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 閱讀(349) | 評(píng)論 (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 閱讀(233) | 評(píng)論 (0)編輯 收藏

    2007年12月19日

        最近在搞一個(gè)j2me的項(xiàng)目, 目標(biāo)手機(jī)的內(nèi)存較小, 程序內(nèi)存分配如果有問(wèn)題會(huì)出現(xiàn)內(nèi)存泄露.   Java的內(nèi)存回收由JVM控制,這給開(kāi)發(fā)者的內(nèi)存管理帶來(lái)了方便的同時(shí), 也會(huì)帶來(lái)一些苦惱(辯證法). 目前用索愛(ài)的模擬器進(jìn)行開(kāi)發(fā), 它的開(kāi)發(fā)工具還是比較健全了,可以進(jìn)行內(nèi)存檢測(cè)(盡管很慢), 來(lái)找出問(wèn)題所在.
        現(xiàn)在已知可以預(yù)防內(nèi)存泄露的措施是:
        使用完的對(duì)象,特別是大對(duì)象即使 置 null, 否則可能陷入循環(huán)引用導(dǎo)致JVM不能釋放.
        減小圖片尺寸.
        減小重新new對(duì)象.
    posted @ 2007-12-19 13:00 Duan Bo Hao 閱讀(571) | 評(píng)論 (0)編輯 收藏
    僅列出標(biāo)題  
     
    主站蜘蛛池模板: 精品无码国产污污污免费| 国产免费爽爽视频在线观看| 最近免费中文字幕mv电影| 亚洲av中文无码乱人伦在线r▽| 日本道免费精品一区二区| 久久亚洲国产精品一区二区| a色毛片免费视频| 亚洲成色WWW久久网站| 午夜免费啪视频在线观看| 亚洲国产精品热久久| 99久热只有精品视频免费观看17| 久久久久久a亚洲欧洲AV| 99久久99久久免费精品小说| 亚洲精品国产专区91在线| 性生交片免费无码看人| 久久亚洲中文字幕无码| 相泽亚洲一区中文字幕| 无码精品国产一区二区三区免费| 亚洲综合无码一区二区三区| 亚洲免费福利在线视频| 国产精品成人亚洲| 亚洲国产a∨无码中文777| ww在线观视频免费观看| 噜噜综合亚洲AV中文无码| 亚洲精品乱码久久久久66| 久久久久久久免费视频| 香蕉视频亚洲一级| 久久91亚洲人成电影网站| 青青青免费国产在线视频小草| 亚洲啪AV永久无码精品放毛片| 亚洲日本在线观看视频| 91精品啪在线观看国产线免费| 亚洲永久网址在线观看| 中文字幕日韩亚洲| A在线观看免费网站大全| 九九免费精品视频在这里| 亚洲视频精品在线观看| 午夜亚洲av永久无码精品| 日韩插啊免费视频在线观看| 国产成人亚洲精品播放器下载 | 性做久久久久免费看|