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

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

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

    java learnging

    一塊探討JAVA的奧妙吧
    posts - 34, comments - 27, trackbacks - 0, articles - 22

    2005年7月13日

    Version Eclipse 3.1

    1.性能

        a. 禁用緩存遠程資源
           Window -> Preferences -> Internet -> Cache -> 選擇Disable Caching
           這樣在打開web.xml等文件時就不會 Loading xmlns 之類的信息了
       
        b. 禁用有效性驗證
           Window -> Preferences -> Validation -> 選擇Deselect All
           可能有效性驗證是個不錯的功能,不過有時候需要花的時間太長,有點受不了,基本上也不怎么需要
        c. 禁用啟動eclipse時自動構建
           Window -> Preferences -> Launching -> 不選擇 Build before launching

    2.個人嗜好

        a. 修改Ant Document Url
           Window -> Preferences -> Ant -> Document Url -> 選擇Ant Document目錄
           這樣要比eclipse默認去apache的網站訪問快多了
       
        b. 修改快捷鍵的設定
           Window -> Preferences -> General -> Keys -> 按自己的需要修改
           尤其是Content assist 這么一個好用的功能和我的輸入法沖突了,只有改了

        c. 修改java文件的source和output folder
           Window -> Preferences -> Java -> Build Path ->選擇 Folders,并設為src和classes
           這樣的項目文件目錄比較標準,不過和maven的標準不太一樣哦

        d. 修改Mark Occerencs
           Window -> Preferences -> Java -> Editor -> Mark Occerencs -> 把Mark Occerencs置為disable
           這樣在選擇一個單詞的時候,與這個單詞“具有同樣含義”的單詞就不會同時加亮了

    posted @ 2005-08-17 17:38 bigseal 閱讀(1487) | 評論 (0)編輯 收藏

    Eclipse 3.0/3.1

    Subclipse releases for Eclipse 3.x are hosted at our update site. Add http://subclipse.tigris.org/update as an update site in Eclipse's update manager (which you can find in the Help menu).

    The update site itself can be downloaded and used as a local update site as well. Simply unzip the site archive, and add the path as a new "Local Site" in the Eclipse update manager. You can also host your own internal Subclipse update site by placing the site on your own HTTP server (be sure to update site.xml appropriately).

    We also provide instructions for installing Subclipse in Eclipse 3.x

    Eclipse 2.1.3

    Subclipse 0.9.3.3 is linked against Subversion 1.1.4. Binaries for Windows are included.

    Development for this version of Eclipse is no longer active. There are no new releases planned.

    Download the Eclipse 2.x version

    Note:如果把文件直接unzip到eclipse的安裝目下,在使用的時候會沒有授權文件文件之類的錯誤。

    posted @ 2005-08-15 12:38 bigseal 閱讀(15295) | 評論 (0)編輯 收藏

    修改默認字符集(default character set)
    在mysql的my.ini配置文件中設置,這樣在mysql啟動后就會自動加載
    例如:把默認字符集設置為UTF-8

    default-character-set=utf8

    查看變量值:
    例如:查看字符集設置

    SHOW VARIABLES LIKE 'character_set_%';
    SHOW VARIABLES LIKE 
    'collation_%'

    設置變量值
    例如:設置字符集變量
     set  character_set_server  = utf8;
     
    set  character_set_system  = utf8;
     
    set  character_set_database  = utf8;
     
    set  character_set_client  = utf8;
     
    set   character_set_connection  = utf8;
     
    set  character_set_results = utf8;
     
     
    set collation_connection = utf8_general_ci;
     
    set collation_database = utf8_general_ci;
     
    set  collation_server = utf8_general_ci;

    posted @ 2005-07-25 17:38 bigseal 閱讀(1436) | 評論 (0)編輯 收藏

    java.util.*

    java.util.StringTokenizer
    作用: 根據標記分割字符串
    例子:

    StringTokenizer st = new StringTokenizer("this is a test");
         
    while (st.hasMoreTokens()) {
             System.
    out.println(st.nextToken());
         }
    結果為:
         this
         is
         a
         test

    但是該類已經不推薦使用了,如果要實現該功能可以通過String類的split方法或 java.util.regex package來代替。
         String[] result = "this is a test".split("\\s");
         
    for (int x=0; x<result.length; x++)
             System.
    out.println(result[x]);
    結果為:
         this
         is
         a
         test

    posted @ 2005-07-22 18:00 bigseal 閱讀(1295) | 評論 (0)編輯 收藏

    Container默認布局管理

    Container       null
    Panel             FlowLayout
    Window        BorderLayout
    Dialog           BorderLayout 
    Frame           BorderLayout

    有幾個用于布局管理的類
    BorderLayout
    CardLayout
    FlowLayout
    GridLayout
    GridBaglayout

    BorderLayout水平擴展南北構件,使這些構件的寬度達到所在容器的寬度,但根據構件的首先高度調整它們的高度。東西構件被垂直擴展,并根據它們的首先寬度調整她們的寬度,中間構件布滿剩下的空間。

    在使用GridBaglayout管理布局時,需要通過GridBagConstraints來指定各構件的約束條件,下面是GridBagConstraints的一些設置
    GridBagConstraints.anchor 構件在顯示區中的位置
    GridBagConstraints.fill         構件填充顯示區的方式
    GridBagConstraints.gridx/gridy  構件左上角的網格單元
    GridBagConstraints.gridwidth/gridheigth 構件顯示區的大小
    GridBagConstraints.weighx/weighy 構件顯示區可以消耗多少額外的空間
    GridBagConstraints.insets 構件的空白區
    GridBagConstraints.ipadx/ipady 構件的內部填充

    posted @ 2005-07-22 17:50 bigseal 閱讀(1624) | 評論 (0)編輯 收藏

    The UML2 project is an EMF-based implementation of the UML 2.0 metamodel for the Eclipse platform designed to support the development of modeling tools. Further objectives of the UML2 project are to provide a common XMI schema to facilitate interchange of semantic models, test cases as a means of validating the specification, and validation rules as a means of defining and enforcing levels of compliance. For more details see Getting Started with UML2

    posted @ 2005-07-15 14:06 bigseal 閱讀(1483) | 評論 (0)編輯 收藏

        有兩種方法要用到對Graphi的引用,這兩種就是傳遞一個對Graphi的引用,或返回對Graphics的引用。

       1 .傳遞一個對Graphi的引用是諸如 void paint(Graphics g)的方法,通過override該方法來達到目的。

    import java.awt.*;

    public class SubPanel extends Panel{

        
    public void paint(Graphics g){
            g.setColor(Color.RED);
            g.drawString(
    "subPanel",5,5);
        }

    }


    2.返回對Graphics的引用是諸如 Graphiics getGraphics() 的方法,直接引用返回的Grapchics。

    import java.awt.*;


    import java.awt.
    *;

    public class SubPanel extends Panel {

        
    public void test() {
            Graphics g 
    = getGraphics();
            
    if (g != null{
                g.setColor(Color.RED);
                g.drawString(
    "subPanel"55);
            }

        }

    }


    其中,如果如果組件當前未顯示getGraphics()方法返回null。

    posted @ 2005-07-13 14:07 bigseal 閱讀(1430) | 評論 (0)編輯 收藏

        AWT是JFC(Java基本類)的核心,為JFC的構成提供了以下的基本結構:

    • 代理事件模型
    • 輕量構件
    • 剪貼板和數據傳輸
    • 打印和無鼠標操作

        Java抽象窗口工具集有四個主要的類,即:構件類(Component)、容器類(Container)、圖形類(Graphics)、和布局管理類(LayoutManager和LayoutMangager2)。容器包含構件,布局管理器確定容器內構件的位置和形狀。圖形(Graphics)類提供在構件中顯示文本框和圖形的方法。

    1.強制一個容器布置它的構件

        在任何時間給定的構件都是有效(valid)或無效(invalid)的。無效的構件需要被布置,而有效的構件不需要。訪問一個 無效容器(它的同位體已經產生)的validate()引起對容器layout()方法的調用。使構件無效的過程不僅使構件自己變得無效,而且也會使構件所在的容器變的無效。
    使構件無效的Component和Container方法:
    void Component.addNotify()
    void Component.show() (invalidates parent container)
    void Component.hide() (invalidates parent container)
    void Component.reshap(int x,int y,int width,int height)
    void Component.setSize(int width,int height)
    void Component.setBounds(int x,int y,int width,int height)
    void Component.setLayout(LayoutManager)
    void Container.add(Component)
    void Container.remove(Component)
    void Container.removeAll(Component)
    void Container.setLayout(LayoutManager)
    因此我們可以把希望重新布置的構件設置為無效,然后調用該構件父容器的validate()方法即可。

    posted @ 2005-07-13 14:04 bigseal 閱讀(1357) | 評論 (0)編輯 收藏

    Timer是一個線程用來調度在后臺線程中運行的計劃任務的使用工具。任務可能計劃只運行一次,或者以一定的時間間隔重復運行。
    下面是一個定時的小程序:

        /**
         * 彈出菜單顯示3秒鐘后自動隱藏
         * 
         
    */

        
    private void timerToHidden() {
            Timer timer 
    = new Timer();

            timer.schedule(
    new TimerTask() {
                
    public void run() {
                    msgWindow.setVisible(
    false);
                }

            }
    3000);
        }

    posted @ 2005-07-13 13:57 bigseal 閱讀(1545) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 久久国产精品萌白酱免费| 成人在线免费视频| 免费播放一区二区三区| 亚洲AV无码成人精品区在线观看| 免费国产va在线观看| 亚洲а∨天堂久久精品| 成在线人视频免费视频 | 黑人粗长大战亚洲女2021国产精品成人免费视频 | 成年女人永久免费观看片| 亚洲私人无码综合久久网| 在线免费视频一区| 相泽南亚洲一区二区在线播放| 国产国产人免费视频成69大陆| 青娱乐在线视频免费观看| 亚洲精品国产精品乱码不卡| 男女拍拍拍免费视频网站| 亚洲av日韩av不卡在线观看| 91视频免费网址| 亚洲精品美女网站| 免费国产a国产片高清网站| 国产日韩在线视频免费播放| 久久久久无码精品亚洲日韩| 91成人免费观看网站| 亚洲欧美在线x视频| 亚洲人成人77777网站| 在线观看免费av网站| 亚洲人成色4444在线观看| 免费一级毛片免费播放| 日韩免费高清播放器| 91嫩草亚洲精品| 天堂亚洲免费视频| 99视频有精品视频免费观看| 亚洲人成无码网站在线观看| 国产福利电影一区二区三区,亚洲国模精品一区 | 亚洲日本中文字幕天天更新| 亚洲无码黄色网址| 91嫩草免费国产永久入口| 亚洲aⅴ无码专区在线观看春色| 亚洲日本中文字幕天堂网| 4399影视免费观看高清直播| 日韩亚洲人成在线综合|