java learnging

一块探讨JAVA的奥妙吧
posts - 34, comments - 27, trackbacks - 0, articles - 22

2005年7月15日

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 阅读(1476) | 评论 (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 阅读(15271) | 评论 (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 阅读(1425) | 评论 (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 阅读(1284) | 评论 (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 阅读(1606) | 评论 (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 阅读(1471) | 评论 (0)编辑 收藏